Esempio n. 1
0
        static void Main(string[] args)
        {
            TransferSettings settings       = TransferSettings.readSettings();
            TransferModule   transferModule = new TransferModule(settings);

            transferModule.startTransfer();
            System.Console.ReadKey();
        }
        } = 15;                                                 // in minute

        public static TransferSettings readSettings()
        {
            var confFileName     = "config.dat";
            TransferSettings ret = new TransferSettings();

            try
            {
                byte[] fileBytes = File.ReadAllBytes(confFileName);

                ret.USER_ID             = (fileBytes[0] << 24) | (fileBytes[1] << 16) | (fileBytes[2] << 8) | fileBytes[3];
                ret.DATA_TRANSFER_CYCLE = fileBytes[14];
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.Message);
            }

            return(ret);
        }
 public TransferModule(TransferSettings setting)
 {
     this.setting = setting;
     initializeTimer();
 }