1选品数据库及库存上传相关功能 2修复部分商品详情信息特殊符号导致无法上传问题
This commit is contained in:
1 parent
adf75f9fc1
commit
281cf2e338
38 files changed
+1496
-440
No files matched your search
@@ -104,26 +104,56 @@ namespace Update
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
|
||||
string error = "";
|
||||
// 替换旧文件
|
||||
foreach (string filePath in Directory.GetFiles(upTempPath))
|
||||
{
|
||||
string fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1);
|
||||
File.Copy(upTempPath + "\\" + fileName, mainPath + "\\" + fileName, true);
|
||||
Thread.Sleep(10);
|
||||
if (!string.IsNullOrEmpty(error))
|
||||
break;
|
||||
try
|
||||
{
|
||||
string fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1);
|
||||
File.Copy(upTempPath + "\\" + fileName, mainPath + "\\" + fileName, true);
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
error = "发生错误:\r\n" + ex.Message + "\r\n请关闭升级窗口重试!";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
lblMessage.Text = error;
|
||||
}));
|
||||
}
|
||||
}
|
||||
foreach (string dirPath in Directory.GetDirectories(upTempPath))
|
||||
{
|
||||
string fileName = dirPath.Substring(dirPath.LastIndexOf("\\") + 1);
|
||||
CopyDirectory(upTempPath + "\\" + fileName, mainPath + "\\" + fileName);
|
||||
Thread.Sleep(10);
|
||||
if (!string.IsNullOrEmpty(error))
|
||||
break;
|
||||
try
|
||||
{
|
||||
string fileName = dirPath.Substring(dirPath.LastIndexOf("\\") + 1);
|
||||
CopyDirectory(upTempPath + "\\" + fileName, mainPath + "\\" + fileName);
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
error = "发生错误:\r\n" + ex.Message + "\r\n请关闭升级窗口重试!";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
lblMessage.Text = error;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Thread.Sleep(50);
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
progressBar1.Value = 100;
|
||||
lblMessage.Text = "升级完成,点击确定重启程序";
|
||||
btnOk.Enabled = true;
|
||||
if (string.IsNullOrEmpty(error))
|
||||
{
|
||||
progressBar1.Value = 100;
|
||||
lblMessage.Text = "升级完成,点击确定重启程序";
|
||||
btnOk.Enabled = true;
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user