Пример #1
0
 static void Download()
 {
     var dest = Global.CWD("latest.zip");
     if (File.Exists(dest))
         File.Delete(dest);
     var url = new PCS_client().GetDownloadUrl("/apps/folder1/latest.zip");
     var d = new SoftwareDownloader
     {
         Info = new DownloaderInfo
         {
             Url = url,
             FileName = dest,
         }
     };
     d.Download();
 }
Пример #2
0
 static bool IsLatest()
 {
     var client = new PCS_client();
     client.DownloadFile("/apps/folder1/version.txt", Global.CWD("latest.txt"));
     var latest = Global.CWD("latest.txt");
     if (!File.Exists(latest))
     {
         return true;
     }
     latest = File.ReadAllText(latest);
     var current = "";
     if (File.Exists(Global.CWD("current.txt")))
         current = File.ReadAllText(Global.CWD("current.txt"));
     return current == latest;
 }