Ejemplo n.º 1
0
 private void timeToSync(object sender, EventArgs e)
 {
     synctimer.Interval = 1000 * 5 * 60;
     textBox1.Text += "\r\nStarter sync - " + DateTime.Now;
     DigipostSync sync = new DigipostSync();
     sync.FileDownloaded += (uri, filename) => textBox1.Text += "\r\nLaster ned " + filename;
     sync.FileUploaded += filename => textBox1.Text += "\r\nLaster opp " + filename;
     sync.Syncronize(Username.Text, Passord.Text, folder.Text);
     textBox1.Text += "\r\nAvslutter sync - " + DateTime.Now;
     textBox1.Text += "\r\n-------------------------------";
 }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     try
     {
         DigipostSync s = new DigipostSync();
         s.FileDownloaded += (uri, filename) => Console.WriteLine("Downloaded " + uri + " to " + filename);
         s.FileUploaded += (filename) => Console.WriteLine("Uploading " + filename);
         s.Syncronize(args[0], args[1], args[2]);
     }
     catch (Exception ex)
     {
         Console.Error.WriteLine("ERROR:" + ex.Message);
         Console.WriteLine(ex.StackTrace);
     }
 }