Example #1
0
        static void Main(string[] args)
        {
            string path = @"D:\PHOENIX\dbc";

            test.Start();
            if (test.InitTable())
            {
                test.InsertDoc();
                test.ToXML();
                test.ToFTP();
            }
            // ChangeDB();
            //  MonitorDirectory(path);


            Bitrix.Start();

            t           = new System.Timers.Timer();
            t.AutoReset = false;
            t.Elapsed  += new System.Timers.ElapsedEventHandler(t_Elapsed);
            t.Interval  = GetInterval();
            t.Start();


            Console.ReadLine();



            // Console.ReadKey();
        }
Example #2
0
        private static void FileSystemWatcher_Changed(object sender, FileSystemEventArgs e)

        {
            DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath);

            if (lastWriteTime != lastRead)
            {
                XMLtoOrder XML  = new XMLtoOrder();
                string     path = e.FullPath;
                System.Threading.Thread.Sleep(3000);
                Order test = XML.GetOrder(path);

                ToBitrix.Start(test);
                lastRead = lastWriteTime;
            }
            // else discard the (duplicated) OnChanged event
        }