提交 a81f053f 编写于 作者: WEI.ZHOU.'s avatar WEI.ZHOU.

fix:修复FTP连接无响应导致程序卡死

上级 baa7b3e2
......@@ -53,71 +53,79 @@
// labUpdateIP
//
this.labUpdateIP.AutoSize = true;
this.labUpdateIP.Location = new System.Drawing.Point(50, 39);
this.labUpdateIP.Location = new System.Drawing.Point(92, 63);
this.labUpdateIP.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labUpdateIP.Name = "labUpdateIP";
this.labUpdateIP.Size = new System.Drawing.Size(36, 13);
this.labUpdateIP.Size = new System.Drawing.Size(75, 21);
this.labUpdateIP.TabIndex = 0;
this.labUpdateIP.Text = "* IP:";
//
// labUpdatePort
//
this.labUpdatePort.AutoSize = true;
this.labUpdatePort.Location = new System.Drawing.Point(41, 137);
this.labUpdatePort.Location = new System.Drawing.Point(75, 221);
this.labUpdatePort.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labUpdatePort.Name = "labUpdatePort";
this.labUpdatePort.Size = new System.Drawing.Size(45, 13);
this.labUpdatePort.Size = new System.Drawing.Size(97, 21);
this.labUpdatePort.TabIndex = 1;
this.labUpdatePort.Text = "* Port:";
//
// labUpdateType
//
this.labUpdateType.AutoSize = true;
this.labUpdateType.Location = new System.Drawing.Point(36, 186);
this.labUpdateType.Location = new System.Drawing.Point(66, 300);
this.labUpdateType.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labUpdateType.Name = "labUpdateType";
this.labUpdateType.Size = new System.Drawing.Size(50, 13);
this.labUpdateType.Size = new System.Drawing.Size(97, 21);
this.labUpdateType.TabIndex = 2;
this.labUpdateType.Text = "* Type:";
//
// labBasePath
//
this.labBasePath.AutoSize = true;
this.labBasePath.Location = new System.Drawing.Point(14, 235);
this.labBasePath.Location = new System.Drawing.Point(26, 380);
this.labBasePath.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labBasePath.Name = "labBasePath";
this.labBasePath.Size = new System.Drawing.Size(72, 13);
this.labBasePath.Size = new System.Drawing.Size(141, 21);
this.labBasePath.TabIndex = 3;
this.labBasePath.Text = "* BasePath:";
//
// labUpdateFTPUserName
//
this.labUpdateFTPUserName.AutoSize = true;
this.labUpdateFTPUserName.Location = new System.Drawing.Point(10, 333);
this.labUpdateFTPUserName.Location = new System.Drawing.Point(18, 538);
this.labUpdateFTPUserName.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labUpdateFTPUserName.Name = "labUpdateFTPUserName";
this.labUpdateFTPUserName.Size = new System.Drawing.Size(76, 13);
this.labUpdateFTPUserName.Size = new System.Drawing.Size(141, 21);
this.labUpdateFTPUserName.TabIndex = 4;
this.labUpdateFTPUserName.Text = "* UserName:";
//
// labUpdateFTPPassWord
//
this.labUpdateFTPPassWord.AutoSize = true;
this.labUpdateFTPPassWord.Location = new System.Drawing.Point(11, 382);
this.labUpdateFTPPassWord.Location = new System.Drawing.Point(20, 617);
this.labUpdateFTPPassWord.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labUpdateFTPPassWord.Name = "labUpdateFTPPassWord";
this.labUpdateFTPPassWord.Size = new System.Drawing.Size(75, 13);
this.labUpdateFTPPassWord.Size = new System.Drawing.Size(141, 21);
this.labUpdateFTPPassWord.TabIndex = 5;
this.labUpdateFTPPassWord.Text = "* PassWord:";
//
// labUpdateRemarks
//
this.labUpdateRemarks.AutoSize = true;
this.labUpdateRemarks.Location = new System.Drawing.Point(36, 431);
this.labUpdateRemarks.Location = new System.Drawing.Point(66, 696);
this.labUpdateRemarks.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labUpdateRemarks.Name = "labUpdateRemarks";
this.labUpdateRemarks.Size = new System.Drawing.Size(50, 13);
this.labUpdateRemarks.Size = new System.Drawing.Size(95, 21);
this.labUpdateRemarks.TabIndex = 6;
this.labUpdateRemarks.Text = "* 备注:";
//
// butCancel
//
this.butCancel.Location = new System.Drawing.Point(204, 471);
this.butCancel.Location = new System.Drawing.Point(374, 761);
this.butCancel.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.butCancel.Name = "butCancel";
this.butCancel.Size = new System.Drawing.Size(75, 23);
this.butCancel.Size = new System.Drawing.Size(138, 37);
this.butCancel.TabIndex = 7;
this.butCancel.Text = "Cancel";
this.butCancel.UseVisualStyleBackColor = true;
......@@ -125,9 +133,10 @@
//
// butCreate
//
this.butCreate.Location = new System.Drawing.Point(113, 471);
this.butCreate.Location = new System.Drawing.Point(207, 761);
this.butCreate.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.butCreate.Name = "butCreate";
this.butCreate.Size = new System.Drawing.Size(75, 23);
this.butCreate.Size = new System.Drawing.Size(138, 37);
this.butCreate.TabIndex = 8;
this.butCreate.Text = "Save";
this.butCreate.UseVisualStyleBackColor = true;
......@@ -135,17 +144,19 @@
//
// textRe
//
this.textRe.Location = new System.Drawing.Point(88, 429);
this.textRe.Location = new System.Drawing.Point(161, 693);
this.textRe.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.textRe.Name = "textRe";
this.textRe.Size = new System.Drawing.Size(191, 20);
this.textRe.Size = new System.Drawing.Size(347, 31);
this.textRe.TabIndex = 9;
this.textRe.TextChanged += new System.EventHandler(this.textRe_TextChanged);
//
// textPW
//
this.textPW.Location = new System.Drawing.Point(88, 380);
this.textPW.Location = new System.Drawing.Point(161, 614);
this.textPW.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.textPW.Name = "textPW";
this.textPW.Size = new System.Drawing.Size(191, 20);
this.textPW.Size = new System.Drawing.Size(347, 31);
this.textPW.TabIndex = 10;
//
// comboBType
......@@ -158,81 +169,89 @@
"PDA",
"CIMPDA",
"CamstarPortal"});
this.comboBType.Location = new System.Drawing.Point(88, 183);
this.comboBType.Location = new System.Drawing.Point(161, 296);
this.comboBType.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.comboBType.Name = "comboBType";
this.comboBType.Size = new System.Drawing.Size(191, 21);
this.comboBType.Size = new System.Drawing.Size(347, 29);
this.comboBType.TabIndex = 11;
//
// textBIP
//
this.textBIP.Enabled = false;
this.textBIP.Location = new System.Drawing.Point(88, 35);
this.textBIP.Location = new System.Drawing.Point(161, 57);
this.textBIP.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.textBIP.Name = "textBIP";
this.textBIP.Size = new System.Drawing.Size(191, 20);
this.textBIP.Size = new System.Drawing.Size(347, 31);
this.textBIP.TabIndex = 12;
//
// textBPort
//
this.textBPort.Enabled = false;
this.textBPort.Location = new System.Drawing.Point(88, 134);
this.textBPort.Location = new System.Drawing.Point(161, 216);
this.textBPort.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.textBPort.Name = "textBPort";
this.textBPort.Size = new System.Drawing.Size(191, 20);
this.textBPort.Size = new System.Drawing.Size(347, 31);
this.textBPort.TabIndex = 13;
//
// textBPath
//
this.textBPath.Enabled = false;
this.textBPath.Location = new System.Drawing.Point(88, 233);
this.textBPath.Location = new System.Drawing.Point(161, 376);
this.textBPath.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.textBPath.Name = "textBPath";
this.textBPath.Size = new System.Drawing.Size(191, 20);
this.textBPath.Size = new System.Drawing.Size(347, 31);
this.textBPath.TabIndex = 14;
//
// textUN
//
this.textUN.Location = new System.Drawing.Point(88, 331);
this.textUN.Location = new System.Drawing.Point(161, 535);
this.textUN.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.textUN.Name = "textUN";
this.textUN.Size = new System.Drawing.Size(191, 20);
this.textUN.Size = new System.Drawing.Size(347, 31);
this.textUN.TabIndex = 15;
//
// comboBUpdateFactory
//
this.comboBUpdateFactory.Enabled = false;
this.comboBUpdateFactory.FormattingEnabled = true;
this.comboBUpdateFactory.Location = new System.Drawing.Point(88, 84);
this.comboBUpdateFactory.Location = new System.Drawing.Point(161, 136);
this.comboBUpdateFactory.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.comboBUpdateFactory.Name = "comboBUpdateFactory";
this.comboBUpdateFactory.Size = new System.Drawing.Size(191, 21);
this.comboBUpdateFactory.Size = new System.Drawing.Size(347, 29);
this.comboBUpdateFactory.TabIndex = 17;
//
// labUpdateFactory
//
this.labUpdateFactory.AutoSize = true;
this.labUpdateFactory.Location = new System.Drawing.Point(25, 88);
this.labUpdateFactory.Location = new System.Drawing.Point(46, 142);
this.labUpdateFactory.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labUpdateFactory.Name = "labUpdateFactory";
this.labUpdateFactory.Size = new System.Drawing.Size(61, 13);
this.labUpdateFactory.Size = new System.Drawing.Size(130, 21);
this.labUpdateFactory.TabIndex = 16;
this.labUpdateFactory.Text = "* Factory:";
//
// textBUpdateFolderPath
//
this.textBUpdateFolderPath.Location = new System.Drawing.Point(88, 282);
this.textBUpdateFolderPath.Location = new System.Drawing.Point(161, 456);
this.textBUpdateFolderPath.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.textBUpdateFolderPath.Name = "textBUpdateFolderPath";
this.textBUpdateFolderPath.Size = new System.Drawing.Size(191, 20);
this.textBUpdateFolderPath.Size = new System.Drawing.Size(347, 31);
this.textBUpdateFolderPath.TabIndex = 19;
//
// labUpdateFolderPath
//
this.labUpdateFolderPath.AutoSize = true;
this.labUpdateFolderPath.Location = new System.Drawing.Point(9, 284);
this.labUpdateFolderPath.Location = new System.Drawing.Point(16, 459);
this.labUpdateFolderPath.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labUpdateFolderPath.Name = "labUpdateFolderPath";
this.labUpdateFolderPath.Size = new System.Drawing.Size(77, 13);
this.labUpdateFolderPath.Size = new System.Drawing.Size(163, 21);
this.labUpdateFolderPath.TabIndex = 18;
this.labUpdateFolderPath.Text = "* FolderPath:";
//
// UpdateAPConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(313, 511);
this.ClientSize = new System.Drawing.Size(574, 825);
this.Controls.Add(this.textBUpdateFolderPath);
this.Controls.Add(this.labUpdateFolderPath);
this.Controls.Add(this.comboBUpdateFactory);
......@@ -253,6 +272,7 @@
this.Controls.Add(this.labUpdateType);
this.Controls.Add(this.labUpdatePort);
this.Controls.Add(this.labUpdateIP);
this.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.MaximizeBox = false;
this.Name = "UpdateAPConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
......
......@@ -83,7 +83,7 @@ namespace SystemUpdateVersion.FormModels
string InsertSQL = string.Empty;
try
{
InsertSQL = $@"UPDATE APConfigDateils ap SET ap.FTPUserName = '{textUN.Text}', ap.FTPPassWord = '{textPW.Text}', ap.Remarks = '{textRe.Text}', ap.ProjectFolderPath = '{textBUpdateFolderPath.Text}' where ap.Factory = '{Factory}' and ap.IP = '{textBIP.Text}' and ap.Port = {textBPort.Text} and ap.Type = '{comboBType.Text}' and ap.Path = '{textBPath.Text}'";
InsertSQL = $@"UPDATE APConfigDateils ap SET ap.FTPUserName = '{textUN.Text}', ap.FTPPassWord = '{textPW.Text}', ap.Remarks = '{textRe.Text}', ap.ProjectFolderPath = '{textBUpdateFolderPath.Text}', ap.Path = '{textBPath.Text}' where ap.Factory = '{Factory}' and ap.IP = '{textBIP.Text}' and ap.Port = {textBPort.Text} and ap.Type = '{comboBType.Text}'";
int res = MdbHepler.Update(InsertSQL);
if (res == 1)
{
......
......@@ -4,6 +4,7 @@ using System.Net;
using System.Security.Policy;
using System.Text;
using SystemUpdateVersion.Models;
using static System.Net.WebRequestMethods;
namespace SystemUpdateVersion.Hepler
{
......@@ -15,6 +16,7 @@ namespace SystemUpdateVersion.Hepler
private string ftpUserID;
private string ftpPassword;
private string ftpURI;
private string TimeOut = INIHelper.ReadINI("FTPConnetConfig","TIME_OUT","5000");
/// <summary>
/// 连接FTP
......@@ -243,6 +245,7 @@ namespace SystemUpdateVersion.Hepler
ftp.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
ftp.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
ftp.UsePassive = false;
ftp.Timeout = GetFTPSettingTimeOut();
WebResponse response = ftp.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.Default);
......@@ -288,6 +291,7 @@ namespace SystemUpdateVersion.Hepler
reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
reqFTP.Method = WebRequestMethods.Ftp.ListDirectory;
reqFTP.UsePassive = false;
reqFTP.Timeout = reqFTP.Timeout = GetFTPSettingTimeOut();
WebResponse response = reqFTP.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.Default);
......@@ -520,6 +524,7 @@ namespace SystemUpdateVersion.Hepler
reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
reqFTP.UseBinary = true;
reqFTP.UsePassive = false;
reqFTP.Timeout = GetFTPSettingTimeOut();
reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
Stream ftpStream = response.GetResponseStream();
......@@ -572,6 +577,7 @@ namespace SystemUpdateVersion.Hepler
reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
reqFTP.UseBinary = true;
reqFTP.UsePassive = false;
reqFTP.Timeout = GetFTPSettingTimeOut();
reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
Stream ftpStream = response.GetResponseStream();
......@@ -609,5 +615,18 @@ namespace SystemUpdateVersion.Hepler
throw new Exception("FtpHelper GetChangeDateTime Error --> " + ex.Message);
}
}
/// <summary>
/// 返回默认设置FTP连接超时时间,未设置超时时间返回默认值5000ms
/// </summary>
/// <returns></returns>
private int GetFTPSettingTimeOut()
{
if (string.IsNullOrWhiteSpace(TimeOut))
{
return 5000;
}
return Convert.ToInt32(TimeOut);
}
}
}
......@@ -44,6 +44,17 @@ namespace SystemUpdateVersion.Hepler
return INIHelper.ReadIni(section, key, "", 255, Environment.CurrentDirectory + @"/Config.ini");
}
/// <summary>
/// 读取Ini配置,设置默认值
/// </summary>
/// <param name="section">section</param>
/// <param name="key">key</param>
/// <returns>Value</returns>
public static string ReadINI(string section, string key, string defualtValue)
{
return INIHelper.ReadIni(section, key, defualtValue, 255, Environment.CurrentDirectory + @" / Config.ini");
}
/// <summary>
/// 保存Ini配置
/// </summary>
......
......@@ -173,7 +173,7 @@ namespace SystemUpdateVersion
this.tabCMain.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.tabCMain.Name = "tabCMain";
this.tabCMain.SelectedIndex = 0;
this.tabCMain.Size = new System.Drawing.Size(2527, 853);
this.tabCMain.Size = new System.Drawing.Size(2527, 1017);
this.tabCMain.TabIndex = 0;
//
// tabPAuthentication
......@@ -182,7 +182,7 @@ namespace SystemUpdateVersion
this.tabPAuthentication.Location = new System.Drawing.Point(4, 31);
this.tabPAuthentication.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.tabPAuthentication.Name = "tabPAuthentication";
this.tabPAuthentication.Size = new System.Drawing.Size(2519, 818);
this.tabPAuthentication.Size = new System.Drawing.Size(2519, 982);
this.tabPAuthentication.TabIndex = 2;
this.tabPAuthentication.Text = "Operation Authentication";
this.tabPAuthentication.UseVisualStyleBackColor = true;
......@@ -200,7 +200,7 @@ namespace SystemUpdateVersion
this.groupBAuthen.Controls.Add(this.butLogin);
this.groupBAuthen.Controls.Add(this.labPassword);
this.groupBAuthen.Controls.Add(this.textBPWD);
this.groupBAuthen.Location = new System.Drawing.Point(844, 147);
this.groupBAuthen.Location = new System.Drawing.Point(844, 198);
this.groupBAuthen.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.groupBAuthen.Name = "groupBAuthen";
this.groupBAuthen.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
......@@ -327,7 +327,7 @@ namespace SystemUpdateVersion
this.tabPAPConfig.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.tabPAPConfig.Name = "tabPAPConfig";
this.tabPAPConfig.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.tabPAPConfig.Size = new System.Drawing.Size(2519, 818);
this.tabPAPConfig.Size = new System.Drawing.Size(2519, 982);
this.tabPAPConfig.TabIndex = 0;
this.tabPAPConfig.Text = "AP Service Config";
this.tabPAPConfig.UseVisualStyleBackColor = true;
......@@ -337,7 +337,7 @@ namespace SystemUpdateVersion
this.gbConfig.Controls.Add(this.butCloseConfig);
this.gbConfig.Controls.Add(this.butAddConfig);
this.gbConfig.Controls.Add(this.button1);
this.gbConfig.Location = new System.Drawing.Point(11, 688);
this.gbConfig.Location = new System.Drawing.Point(11, 846);
this.gbConfig.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.gbConfig.Name = "gbConfig";
this.gbConfig.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
......@@ -398,7 +398,7 @@ namespace SystemUpdateVersion
this.listView1.Location = new System.Drawing.Point(0, 0);
this.listView1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(2513, 676);
this.listView1.Size = new System.Drawing.Size(2513, 823);
this.listView1.TabIndex = 1;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
......@@ -417,7 +417,7 @@ namespace SystemUpdateVersion
// chIP
//
this.chIP.Text = "IP";
this.chIP.Width = 250;
this.chIP.Width = 200;
//
// cHPort
//
......@@ -427,7 +427,7 @@ namespace SystemUpdateVersion
// chType
//
this.chType.Text = "Type";
this.chType.Width = 150;
this.chType.Width = 100;
//
// chPath
//
......@@ -437,12 +437,12 @@ namespace SystemUpdateVersion
// chProjectFolderPath
//
this.chProjectFolderPath.Text = "ProjectFolderPath";
this.chProjectFolderPath.Width = 350;
this.chProjectFolderPath.Width = 300;
//
// chUserName
//
this.chUserName.Text = "FTPUserName";
this.chUserName.Width = 300;
this.chUserName.Width = 250;
//
// chRemarks
//
......@@ -498,7 +498,7 @@ namespace SystemUpdateVersion
this.tabPAPOperation.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.tabPAPOperation.Name = "tabPAPOperation";
this.tabPAPOperation.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.tabPAPOperation.Size = new System.Drawing.Size(2519, 818);
this.tabPAPOperation.Size = new System.Drawing.Size(2519, 982);
this.tabPAPOperation.TabIndex = 1;
this.tabPAPOperation.Text = "AP Service Operation";
this.tabPAPOperation.UseVisualStyleBackColor = true;
......@@ -510,7 +510,7 @@ namespace SystemUpdateVersion
this.groupBox1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.groupBox1.Size = new System.Drawing.Size(562, 788);
this.groupBox1.Size = new System.Drawing.Size(562, 936);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "ChangeDateTime";
......@@ -524,7 +524,7 @@ namespace SystemUpdateVersion
this.textBChangeDateTime.Multiline = true;
this.textBChangeDateTime.Name = "textBChangeDateTime";
this.textBChangeDateTime.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBChangeDateTime.Size = new System.Drawing.Size(537, 737);
this.textBChangeDateTime.Size = new System.Drawing.Size(537, 864);
this.textBChangeDateTime.TabIndex = 3;
//
// gBOperation
......@@ -547,7 +547,7 @@ namespace SystemUpdateVersion
this.gBOperation.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.gBOperation.Name = "gBOperation";
this.gBOperation.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.gBOperation.Size = new System.Drawing.Size(1031, 499);
this.gBOperation.Size = new System.Drawing.Size(1031, 647);
this.gBOperation.TabIndex = 2;
this.gBOperation.TabStop = false;
this.gBOperation.Text = "更版操作";
......@@ -683,7 +683,7 @@ namespace SystemUpdateVersion
this.liVFTPRes.Location = new System.Drawing.Point(11, 221);
this.liVFTPRes.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.liVFTPRes.Name = "liVFTPRes";
this.liVFTPRes.Size = new System.Drawing.Size(1008, 266);
this.liVFTPRes.Size = new System.Drawing.Size(1008, 393);
this.liVFTPRes.TabIndex = 2;
this.liVFTPRes.UseCompatibleStateImageBehavior = false;
this.liVFTPRes.View = System.Windows.Forms.View.Details;
......@@ -742,7 +742,7 @@ namespace SystemUpdateVersion
this.gBSelectAP.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.gBSelectAP.Name = "gBSelectAP";
this.gBSelectAP.Padding = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.gBSelectAP.Size = new System.Drawing.Size(861, 499);
this.gBSelectAP.Size = new System.Drawing.Size(861, 649);
this.gBSelectAP.TabIndex = 1;
this.gBSelectAP.TabStop = false;
this.gBSelectAP.Text = "选择AP";
......@@ -814,7 +814,7 @@ namespace SystemUpdateVersion
this.cLBAPS.Location = new System.Drawing.Point(537, 108);
this.cLBAPS.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.cLBAPS.Name = "cLBAPS";
this.cLBAPS.Size = new System.Drawing.Size(312, 368);
this.cLBAPS.Size = new System.Drawing.Size(312, 508);
this.cLBAPS.TabIndex = 3;
this.cLBAPS.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.cLBAPS_ItemCheck);
//
......@@ -970,7 +970,7 @@ namespace SystemUpdateVersion
this.tabPMonitor.Location = new System.Drawing.Point(4, 31);
this.tabPMonitor.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.tabPMonitor.Name = "tabPMonitor";
this.tabPMonitor.Size = new System.Drawing.Size(2519, 818);
this.tabPMonitor.Size = new System.Drawing.Size(2519, 982);
this.tabPMonitor.TabIndex = 3;
this.tabPMonitor.Text = "AP Version Monitor";
this.tabPMonitor.UseVisualStyleBackColor = true;
......@@ -1290,7 +1290,7 @@ namespace SystemUpdateVersion
//
this.labSchedule.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labSchedule.ForeColor = System.Drawing.SystemColors.ControlDark;
this.labSchedule.Location = new System.Drawing.Point(2020, 857);
this.labSchedule.Location = new System.Drawing.Point(2020, 1026);
this.labSchedule.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labSchedule.Name = "labSchedule";
this.labSchedule.Size = new System.Drawing.Size(183, 21);
......@@ -1300,7 +1300,7 @@ namespace SystemUpdateVersion
//
// progressBar
//
this.progressBar.Location = new System.Drawing.Point(2210, 861);
this.progressBar.Location = new System.Drawing.Point(2210, 1030);
this.progressBar.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.progressBar.Name = "progressBar";
this.progressBar.Size = new System.Drawing.Size(262, 16);
......@@ -1311,7 +1311,7 @@ namespace SystemUpdateVersion
this.labNum.AutoSize = true;
this.labNum.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labNum.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
this.labNum.Location = new System.Drawing.Point(2478, 858);
this.labNum.Location = new System.Drawing.Point(2478, 1027);
this.labNum.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labNum.Name = "labNum";
this.labNum.Size = new System.Drawing.Size(33, 20);
......@@ -1323,7 +1323,7 @@ namespace SystemUpdateVersion
this.labRole.AutoSize = true;
this.labRole.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labRole.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
this.labRole.Location = new System.Drawing.Point(37, 855);
this.labRole.Location = new System.Drawing.Point(37, 1024);
this.labRole.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labRole.Name = "labRole";
this.labRole.Size = new System.Drawing.Size(48, 20);
......@@ -1335,7 +1335,7 @@ namespace SystemUpdateVersion
this.labWorkNumber.AutoSize = true;
this.labWorkNumber.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labWorkNumber.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
this.labWorkNumber.Location = new System.Drawing.Point(152, 855);
this.labWorkNumber.Location = new System.Drawing.Point(152, 1024);
this.labWorkNumber.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labWorkNumber.Name = "labWorkNumber";
this.labWorkNumber.Size = new System.Drawing.Size(0, 20);
......@@ -1345,7 +1345,7 @@ namespace SystemUpdateVersion
//
this.labFactoryTag.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labFactoryTag.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
this.labFactoryTag.Location = new System.Drawing.Point(297, 855);
this.labFactoryTag.Location = new System.Drawing.Point(297, 1024);
this.labFactoryTag.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labFactoryTag.Name = "labFactoryTag";
this.labFactoryTag.Size = new System.Drawing.Size(128, 21);
......@@ -1358,7 +1358,7 @@ namespace SystemUpdateVersion
this.labFactoryValue.AutoSize = true;
this.labFactoryValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labFactoryValue.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
this.labFactoryValue.Location = new System.Drawing.Point(433, 856);
this.labFactoryValue.Location = new System.Drawing.Point(433, 1025);
this.labFactoryValue.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.labFactoryValue.Name = "labFactoryValue";
this.labFactoryValue.Size = new System.Drawing.Size(0, 20);
......@@ -1375,7 +1375,7 @@ namespace SystemUpdateVersion
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(2539, 883);
this.ClientSize = new System.Drawing.Size(2539, 1057);
this.Controls.Add(this.labFactoryValue);
this.Controls.Add(this.labFactoryTag);
this.Controls.Add(this.labWorkNumber);
......
......@@ -585,7 +585,7 @@ namespace SystemUpdateVersion
//备份文件目录
string VersionBackupPathBase = GetVersionBackupPathBase();
string DataString = DateTime.Now.ToString("yyyyMMddHH");
string DataString = DateTime.Now.ToString("yyyyMMddHHmmss");
teBBackupDir.Text = DataString;
SelectAPList = GetSelectAP();
APConfigModel item = SelectAPList[0];
......@@ -612,7 +612,7 @@ namespace SystemUpdateVersion
{
_filepath = filePath.Replace("\\", "/");
string[] filepathSpit = _filepath.Split('/');
_LocaFilepath = $@"{VersionBackupPathBase}/{DataString}/{filepathSpit[(filepathSpit.Count() - 1)]}";
_LocaFilepath = $@"{VersionBackupPathBase}/{item.IP}/{DataString}/{filepathSpit[(filepathSpit.Count() - 1)]}";
ftp.DownloadFile(filepathSpit[(filepathSpit.Count() - 1)], _LocaFilepath);
FTPResStatusPush(item.IP, _LocaFilepath, true, FTPType.BackupVersion);
//LogHepler.WriterLog(OperationUserName, $"{item.IP} {_LocaFilepath} {true}", "备份状态");
......@@ -637,7 +637,7 @@ namespace SystemUpdateVersion
{
_filepath = LocalFilesPathArray[index].Replace("\\", "/");
string[] filepathSpit = _filepath.Split('/');
_LocaFilepath = $@"{VersionBackupPathBase}/{DataString}/{_RemoteFilesPathByAP[index].Replace("\\", "/")}{filepathSpit[(filepathSpit.Count() - 1)]}";
_LocaFilepath = $@"{VersionBackupPathBase}/{item.IP}/{DataString}/{_RemoteFilesPathByAP[index].Replace("\\", "/")}{filepathSpit[(filepathSpit.Count() - 1)]}";
string _RemoctPath = _RemoteFilesPathByAP[index].Replace("\\", "/") + filepathSpit[(filepathSpit.Count() - 1)];
ftp.DownloadFile(_RemoctPath, _LocaFilepath);
FTPResStatusPush(item.IP, _LocaFilepath, true, FTPType.BackupVersion);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册