public void Execute(object parameter) { if (PackageSubVM.Instance.szLastVersion == "") { MessageBox.Show("没有生成版本文件."); return; } bool bUploadResult = true; FtpHelper ftp = new FtpHelper("113.107.167.229", "root", "#!9BVAPlDJ2%Nj@z"); bUploadResult = bUploadResult && ftp.sftpUpload(PackageSubVM.Instance.OutPath + @"\versions", PackageSubVM.Instance.UploadVersionUrl + "/versions"); string editionFileName = PackageSubVM.Instance.szLastVersion + "-" + PackageSubVM.Instance.Version; bUploadResult = bUploadResult && ftp.sftpUpload(PackageSubVM.Instance.szDifferentOutPath + @"\" + editionFileName + ".zip", PackageSubVM.Instance.UploadVersionUrl + String.Format("/edition/{0}.zip", editionFileName)); bUploadResult = bUploadResult && ftp.sftpUpload(PackageSubVM.Instance.szDifferentOutPath + @"\" + editionFileName + ".xml", PackageSubVM.Instance.UploadVersionUrl + String.Format("/edition/{0}.xml", editionFileName)); if (bUploadResult) { MessageBox.Show("上传成功!"); } else { MessageBox.Show("上传失败, 请重新上传."); } }
public void Execute(object parameter) { FtpHelper ftp = new FtpHelper(); bool ok = ftp.httpRequest("GET", "", PackageSubVM.Instance.requestResult) == "True"; if (!ok) { PackageSubVM.Instance.CheckFlushTimer = new System.Timers.Timer(); PackageSubVM.Instance.CheckFlushTimer.Elapsed += new System.Timers.ElapsedEventHandler(dt_Tick); PackageSubVM.Instance.CheckFlushTimer.Interval = 20000; PackageSubVM.Instance.CheckFlushTimer.Enabled = true; } else { MessageBox.Show("刷新成功!"); } }
public void Execute(object parameter) { if (true || PackageSubVM.Instance.FlushCDNUrl != "") { FtpHelper ftp = new FtpHelper(); PackageSubVM.Instance.requestResult = ftp.httpRequest("POST", PackageSubVM.Instance.FlushCDNUrl, ""); //ftp.TencentCDNRequest("asldkfj"); } else { string url = "http://push.dnion.com/cdnUrlPush.do?captcha=436bd644&type=0&url=http://shenqu.cdn.feiliu.com/update/"; System.Diagnostics.Process.Start(url); } }
public static void dt_Tick(object sender, EventArgs e) { // check flush FtpHelper ftp = new FtpHelper(); bool ok = ftp.httpRequest("GET", "", PackageSubVM.Instance.requestResult) == "True"; if (ok) { PackageSubVM.Instance.CheckFlushTimer.Dispose(); MessageBox.Show("刷新成功!"); } }