## 2025-04-24 星期四更新
### SuperDesign V3.0.2504.2401 #### 项目功能->更新日志 - *.[新增]支持将更新日志直接更新到FTP上。 #### 网页抓取工具 - *.[修复]修复API编辑器在某些情况下因为时间戳识别错误导致报错的BUG。
This commit is contained in:
1 parent
7d0c050763
commit
30afab3ce9
14 files changed
+217
-29
No files matched your search
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -21,13 +22,28 @@ namespace SuperDesign.Manager.FTP
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新日志模式
|
||||
/// </summary>
|
||||
public bool UpdateLogMode { get; set; } = false;
|
||||
/// <summary>
|
||||
/// 更新日志
|
||||
/// </summary>
|
||||
public string UpdateHtml { get; set; } = "";
|
||||
public string LocalPath { get; set; } = "";
|
||||
public string EngName { get; set; } = "";
|
||||
public int FTPId { get; set; } = 0;
|
||||
public string RemoteDir { get; set; } = "";
|
||||
private void BtnUploadZSB_Click(object sender, EventArgs e)
|
||||
{
|
||||
Upload(EngName+".zip");
|
||||
if (UpdateLogMode)
|
||||
{
|
||||
Upload(EngName + ".html_bak");
|
||||
}
|
||||
else
|
||||
{
|
||||
Upload(EngName + ".zip");
|
||||
}
|
||||
}
|
||||
private void Upload(string filename)
|
||||
{
|
||||
@@ -44,6 +60,32 @@ namespace SuperDesign.Manager.FTP
|
||||
var opened = ftp.Open(ftp_info);
|
||||
if (opened == 1)
|
||||
{
|
||||
if(UpdateLogMode)
|
||||
{
|
||||
var local_mod_file = System.IO.Path.GetDirectoryName(LocalPath) + "\\_mod.html";
|
||||
var fileinfo = ftp.GetFileInfo(RemoteDir + "/_mod.html");
|
||||
if(fileinfo!=null)
|
||||
{
|
||||
var local_dt = RyFiles.GetFileDate(local_mod_file);
|
||||
if(fileinfo.LastWriteTime>local_dt.LastWriteTime)
|
||||
{
|
||||
if(ftp.Download(RemoteDir + "/_mod.html", local_mod_file)==1)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(System.IO.File.Exists(local_mod_file))
|
||||
{
|
||||
var html= System.IO.File.ReadAllText(local_mod_file).Replace("<%content%>",UpdateHtml);
|
||||
var local_html_file = System.IO.Path.GetDirectoryName(LocalPath) + "\\"+EngName+".html";
|
||||
RyFiles.WriteAllText(local_html_file, html);
|
||||
if (ftp.Upload(local_html_file, RemoteDir + "/" + EngName + ".html") != 1)
|
||||
{
|
||||
MessageBox.Show("本地目录:" + local_html_file + "\r\n远程目录:" + RemoteDir + "/" + EngName + ".html" + "\r\n" + ftp.LastError, "出错", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ftp.Upload(LocalPath, RemoteDir + "/" + filename)!=1)
|
||||
{
|
||||
MessageBox.Show("本地目录:"+ LocalPath + "\r\n远程目录:"+ RemoteDir + "/" + filename+"\r\n"+ftp.LastError,"出错",MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
@@ -76,7 +118,14 @@ namespace SuperDesign.Manager.FTP
|
||||
|
||||
private void BtnUploadBeta_Click(object sender, EventArgs e)
|
||||
{
|
||||
Upload(EngName + "_beta.zip");
|
||||
if (UpdateLogMode)
|
||||
{
|
||||
Upload(EngName + "_beta.html_bak");
|
||||
}
|
||||
else
|
||||
{
|
||||
Upload(EngName + "_beta.zip");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user