## 2025-03-30 星期日更新

### RySmartEditor    V1.0.2503.3001
- *.[新增]在文件管理器中新增支持将所有站点对应的文件上传到FTP。
- *.[新增]新增支持自动同步选定文件到最新版。
### SuperDesign    V3.0.2503.3001
#### 项目功能->更新日志
- *.[修复]修复当更新日志为空时,插入更新分组会报错的BUG。
- *.[修复]修复存在多个分组时,添加修复日志会添加到最后一个分组末尾的BUG。
#### 网页抓取工具
- *.[改进]改进网页图标获取,支持获取更多网站的图标。
- *.[修复]修复当图标文件夹不存在时,读取图标会报错的BUG。
- *.[修复]修复当Url不是图片地址时,勾选获取图片会报错的BUG。
- *.[修复]某些情况下,当目标网站图标不存在时,点击执行按钮时会长时间等待的BUG。
- *.[修复]修复剪切板读取失败可能会导致程序异常退出的BUG。
- *.[修复]修复历史记录里的UserAgent值不正确导致无法执行操作的BUG。
This commit is contained in:
紫林软件 2025-03-30 10:04:25 +08:00
parent 1f8c54fe38
commit 7d0c050763
22 changed files with 1084 additions and 293 deletions

Binary file not shown.

View File

@ -2423,21 +2423,23 @@
<param name="bytes"></param>
<returns></returns>
</member>
<member name="M:ryCommon.RyImage.LoadPic(System.String,System.String)">
<member name="M:ryCommon.RyImage.LoadPic(System.String,System.String,System.Int32)">
<summary>
从文件或Url中加载图片,使用本方法,不会导致图片文件被占用。(如果是webp格式,需要引入OpenXmlPowerTools)
</summary>
<param name="url"></param>
<param name="Referer"></param>
<param name="Timeout"></param>
<returns></returns>
</member>
<member name="M:ryCommon.RyImage.LoadPic(System.String,System.Byte[]@,System.String)">
<member name="M:ryCommon.RyImage.LoadPic(System.String,System.Byte[]@,System.String,System.Int32)">
<summary>
从文件或Url中加载图片,使用本方法,不会导致图片文件被占用。(如果是webp格式,需要引入OpenXmlPowerTools)
</summary>
<param name="url"></param>
<param name="ImgByte"></param>
<param name="Referer"></param>
<param name="Timeout"></param>
<returns></returns>
</member>
<member name="M:ryCommon.RyImage.SaveHighQualityImage(System.Drawing.Bitmap,System.String,ryCommon.Pram.ImageType)">
@ -14799,6 +14801,13 @@
<param name="sender"></param>
<param name="e"></param>
</member>
<member name="T:RyWeb.HttpServer.HttpErrorHandler">
<summary>
</summary>
<param name="sender"></param>
<param name="e"></param>
</member>
<member name="E:RyWeb.HttpServer.OnHandleGETRequest">
<summary>
当收到Get事件时激发
@ -14809,6 +14818,11 @@
当收到Post事件时激发
</summary>
</member>
<member name="E:RyWeb.HttpServer.OnError">
<summary>
当收到错误时激发
</summary>
</member>
<member name="P:RyWeb.HttpServer.ListenerHost">
<summary>
监听的主机,默认是localhost
@ -14819,11 +14833,13 @@
最后一次错误信息
</summary>
</member>
<member name="M:RyWeb.HttpServer.#ctor(System.Int32)">
<member name="M:RyWeb.HttpServer.#ctor(System.Int32,System.Boolean,RyWeb.HttpServer.HttpErrorHandler)">
<summary>
在此端口建立Http服务类
</summary>
<param name="port">端口号</param>
<param name="isStart">是否直接启动服务</param>
<param name="OnError">端口号</param>
</member>
<member name="M:RyWeb.HttpServer.IsRunning">
<summary>
@ -22194,6 +22210,12 @@
</summary>
</member>
<member name="M:ryControls.TextBoxEx2.OnClick(System.EventArgs)">
<summary>
</summary>
<param name="e"></param>
</member>
<member name="P:ryControls.TextBoxEx2.LongTime">
<summary>
指定毫秒没更新内容,为0表示不激发此事件
@ -22280,21 +22302,11 @@
</summary>
<param name="e"></param>
</member>
<member name="M:ryControls.TextBoxEx2.EmptyShow">
<summary>
文本为空时的显示效果
</summary>
</member>
<member name="P:ryControls.TextBoxEx2.Font">
<summary>
字体
</summary>
</member>
<member name="M:ryControls.TextBoxEx2.HaveTextShow">
<summary>
有内容时的显示效果
</summary>
</member>
<member name="P:ryControls.TextBoxEx2.EmptyText">
<summary>
当文本框为空时,显示的内容。

View File

@ -1,4 +1,4 @@
<root>
<list id="LastUpdateTime" Value="2025/1/27 15:19:32" />
<list id="LastUpdateTime" Value="2025/3/14 13:47:24" />
<list id="UpdateAfterTime" Value="0" />
</root>

View File

@ -1,4 +1,22 @@
## :date:2025-01-27 星期一更新
## :date:2025-03-30 星期日更新
### RySmartEditor V1.0.2503.3001
- :cactus:[新增]在文件管理器中新增支持将所有站点对应的文件上传到FTP。
- :cactus:[新增]新增支持自动同步选定文件到最新版。
### SuperDesign V3.0.2503.3001
#### 项目功能->更新日志
- :lady_beetle:[修复]修复当更新日志为空时,插入更新分组会报错的BUG。
- :lady_beetle:[修复]修复存在多个分组时,添加修复日志会添加到最后一个分组末尾的BUG。
#### 网页抓取工具
- :100:[改进]改进网页图标获取,支持获取更多网站的图标。
- :lady_beetle:[修复]修复当图标文件夹不存在时,读取图标会报错的BUG。
- :lady_beetle:[修复]修复当Url不是图片地址时,勾选获取图片会报错的BUG。
- :lady_beetle:[修复]某些情况下,当目标网站图标不存在时,点击执行按钮时会长时间等待的BUG。
- :lady_beetle:[修复]修复剪切板读取失败可能会导致程序异常退出的BUG。
- :lady_beetle:[修复]修复历史记录里的UserAgent值不正确导致无法执行操作的BUG。
## :date:2025-01-27 星期一更新
### RySmartEditor V1.0.2501.2701

View File

@ -4,9 +4,7 @@
支持OS:Windows | 支持框架:.NET 4.6.2 | [更新日志](CHANGELOG.md)
---
#### 特性
### 特性
- 支持各种编码解码。
- 支持时间戳转换。

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2501.2701")]
[assembly: AssemblyFileVersion("1.0.2501.2701")]
[assembly: AssemblyVersion("1.0.2503.3001")]
[assembly: AssemblyFileVersion("1.0.2503.3001")]

View File

@ -56,7 +56,11 @@
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
this.FTPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.FTPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MenuDir = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -68,7 +72,6 @@
this.TxtSearch = new ryControls.TextBoxEx2();
this.MenuDirHistory = new System.Windows.Forms.ContextMenuStrip(this.components);
this.fileSystemWatcher1 = new System.IO.FileSystemWatcher();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MenuForm.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.olvFiles)).BeginInit();
this.contextMenuStrip1.SuspendLayout();
@ -264,48 +267,51 @@
this.toolStripMenuItem1,
this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.FTPToolStripMenuItem});
this.ToolStripMenuItem,
this.toolStripMenuItem3,
this.FTPToolStripMenuItem,
this.FTPToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(221, 280);
this.contextMenuStrip1.Size = new System.Drawing.Size(233, 330);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
//
// 复制文件名ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "复制文件名ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "复制文件名";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(217, 6);
this.toolStripMenuItem2.Size = new System.Drawing.Size(229, 6);
//
// 新建文件夹ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "新建文件夹ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "新建文件夹";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 复制ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "复制ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "复制";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 剪切ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "剪切ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "剪切";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 粘贴ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "粘贴ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "粘贴";
this.ToolStripMenuItem.Visible = false;
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
@ -313,43 +319,69 @@
// 粘贴剪切板文件列表ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "粘贴剪切板文件列表ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "粘贴";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 删除文件ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "删除文件ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "删除文件";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 重命名ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "重命名ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "重命名";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(217, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(229, 6);
//
// 在资源管理器中定位该文件ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "在资源管理器中定位该文件ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "在资源管理器中定位该文件";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 复制文件到其它站点同位置ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "复制文件到其它站点同位置ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "复制文件到其它站点同位置";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 同步所有站点文件为最新版本ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "同步所有站点文件为最新版本ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.ToolStripMenuItem.Text = "同步所有站点文件为最新版本";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(229, 6);
//
// 上传到FTPToolStripMenuItem
//
this.FTPToolStripMenuItem.Name = "上传到FTPToolStripMenuItem";
this.FTPToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.FTPToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.FTPToolStripMenuItem.Text = "上传到FTP";
this.FTPToolStripMenuItem.Click += new System.EventHandler(this.FTPToolStripMenuItem_Click);
//
// 上传全部站点对应文件到FTPToolStripMenuItem
//
this.FTPToolStripMenuItem.Name = "上传全部站点对应文件到FTPToolStripMenuItem";
this.FTPToolStripMenuItem.Size = new System.Drawing.Size(232, 22);
this.FTPToolStripMenuItem.Text = "上传全部站点对应文件到FTP";
this.FTPToolStripMenuItem.Click += new System.EventHandler(this.FTPToolStripMenuItem_Click);
//
// MenuDir
//
this.MenuDir.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -485,13 +517,6 @@
this.fileSystemWatcher1.Deleted += new System.IO.FileSystemEventHandler(this.FileSystemWatcher1_Deleted);
this.fileSystemWatcher1.Renamed += new System.IO.RenamedEventHandler(this.FileSystemWatcher1_Renamed);
//
// 复制文件到其它站点同位置ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "复制文件到其它站点同位置ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.ToolStripMenuItem.Text = "复制文件到其它站点同位置";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// FrmFileBrowser_New
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -563,5 +588,8 @@
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.IO.FileSystemWatcher fileSystemWatcher1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem FTPToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
}
}

View File

@ -473,22 +473,22 @@ namespace SuperDesign.Tools.SmartEditor
private void FTPToolStripMenuItem_Click(object sender, EventArgs e) {
var list = this.olvFiles.SelectedObjects;
List<UploadInfo> UploadList = new List<UploadInfo>();
for (int l = 0; l < list.Count; l++)
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
MyFileSystemInfo model = (MyFileSystemInfo)list[l];
if (model != null)
for (int l = 0; l < list.Count; l++)
{
//if (System.IO.Directory.Exists(model.FullName))
//{
// MessageBox.Show("暂不支持上传文件夹=>" + model.FullName, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
// continue ;
//}
string FilePath = model.FullName;
SiteInfo SiteInfo = new SiteInfo();
UploadInfo uploadinfo = null;
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
MyFileSystemInfo model = (MyFileSystemInfo)list[l];
if (model != null)
{
//if (System.IO.Directory.Exists(model.FullName))
//{
// MessageBox.Show("暂不支持上传文件夹=>" + model.FullName, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
// continue ;
//}
string FilePath = model.FullName;
SiteInfo SiteInfo = new SiteInfo();
UploadInfo uploadinfo = null;
DataSet ds = db.ReadData("select * from Site");
if (ds.HaveData())
{
@ -534,20 +534,19 @@ namespace SuperDesign.Tools.SmartEditor
};
}
ds.Dispose();
}
db.Free();
if (SiteInfo.FtpId > 0)
{
if (uploadinfo == null) { MessageBox.Show("没有找到对应站点信息=>" + model.FullName, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); }
if (SiteInfo.FtpId > 0)
{
if (uploadinfo == null) { MessageBox.Show("没有找到对应站点信息=>" + model.FullName, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); }
else
{
UploadList.Add(uploadinfo);
}
}
else
{
UploadList.Add(uploadinfo);
MessageBox.Show("没有找到对应FTP信息=>" + model.FullName, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
else
{
MessageBox.Show("没有找到对应FTP信息=>" + model.FullName, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
}
if (UploadList.Count > 0)
@ -1281,6 +1280,246 @@ namespace SuperDesign.Tools.SmartEditor
//olvFiles.RemoveObjects(del_list);
}
}
private void FTPToolStripMenuItem_Click(object sender, EventArgs e)
{
var list = this.olvFiles.SelectedObjects;
var files=new List<string>();
List<UploadInfo> UploadList = new List<UploadInfo>();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
for (int l = 0; l < list.Count; l++)
{
MyFileSystemInfo model = (MyFileSystemInfo)list[l];
if (model != null)
{
//if (System.IO.Directory.Exists(model.FullName))
//{
// MessageBox.Show("暂不支持上传文件夹=>" + model.FullName, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
// continue ;
//}
string FilePath = model.FullName;
DataSet ds = db.ReadData("select * from Site");
if (ds.HaveData())
{
for (int m = 0; m < list.Count; m++)
{
var row = (MyFileSystemInfo)list[m];
var xd_path = "";
var cur_Id = -1;
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow reader = ds.Tables[0].Rows[i];
if (row.FullName.IndexOfEx(reader["localPath"].ToString()) < 0)
{
continue;
}
xd_path = row.FullName.Replace(reader["localPath"].ToString(), "", true).Trim('\\');
cur_Id = reader["id"].ToInt();
break;
}
if (cur_Id == -1)
{
MessageBox.Show("当前选定的文件无法获取站点信息。", "无法获取站点", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
files.Add(model.FullName);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow reader = ds.Tables[0].Rows[i];
if (cur_Id == reader["id"].ToInt()) { continue; }
var same_file_path = reader["localPath"].ToString() + "\\" + xd_path;
if (RyFiles.FileOrDirExist(same_file_path))
{ files.Add(same_file_path); }
}
}
}
}
ds.Dispose();
}
}
}
for (int f = 0; f < files.Count; f++)
{
//if (System.IO.Directory.Exists(model.FullName))
//{
// MessageBox.Show("暂不支持上传文件夹=>" + model.FullName, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
// continue ;
//}
string FilePath = files[f];
SiteInfo SiteInfo = new SiteInfo();
UploadInfo uploadinfo = null;
DataSet ds = db.ReadData("select * from Site");
if (ds.HaveData())
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow reader = ds.Tables[0].Rows[i];
if (FilePath.IndexOfEx(reader["localPath"].ToString()) < 0)
{
continue;
}
#region
SiteInfo.Name = reader["name"].ToString();
SiteInfo.LocalPath = reader["localPath"].ToString();
SiteInfo.FtpDir = reader["ftpDir"].ToString();
SiteInfo.FtpId = reader["ftpId"].ToInt();
SiteInfo.Id = reader["Id"].ToInt();
break;
#endregion
}
}
ds.Dispose();
ds = db.ReadData("select * from Ftp where Id=" + SiteInfo.FtpId);
if (ds.HaveData())
{
DataRow row = ds.Tables[0].Rows[0];
var FtpInfo = new GameBackup3H3.DbOp.FTPInfo()
{
Id = row["id"].ToInt(),
Name = row["name"].ToString(),
IP = row["ip"].ToString(),
Port = row["port"].ToInt(),
RemoteDir = SiteInfo.FtpDir,
UserName = row["username"].ToString(),
Pwd = row["pwd"].ToString(),
Encrypt = row["encrypt"].ToInt(0, 2, 0),
AddTime = row["AddTime"].ToDateTime()
};
uploadinfo = new UploadInfo()
{
FtpInfo = FtpInfo,
RemotePath = SiteInfo.FtpDir.Trim('/') + "/" + FilePath.Replace(SiteInfo.LocalPath, "", true).Trim('\\').Replace("\\", "/"),
LocalPath = FilePath
};
}
ds.Dispose();
if (SiteInfo.FtpId > 0)
{
if (uploadinfo == null) { MessageBox.Show("没有找到对应站点信息=>" + FilePath, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); }
else
{
UploadList.Add(uploadinfo);
}
}
else
{
MessageBox.Show("没有找到对应FTP信息=>" + FilePath, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
db.Free();
if (UploadList.Count > 0)
{
FrmUploadProg frm = new FrmUploadProg();
frm.UploadList.AddRange(UploadList);
if (frm.ShowDialog() == DialogResult.OK)
{
//MessageBox.Show("上传成功。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("上传失败。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
frm.Dispose();
}
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
var list = this.olvFiles.SelectedObjects;
if (list.Count > 0)
{
switch (MessageBox.Show("确定要检索所有站点,将最新版本的文件,同步到其它存有老版本文件的站点?\r\n将选定" + list.Count + "个文件进行分析?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
return;
}
this.Enabled = false;
Thread th = new Thread(Start);
th.Start();
void Start()
{
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds = db.ReadData("select * from Site");
if (ds.HaveData())
{
for (int m = 0; m < list.Count; m++)
{
var row = (MyFileSystemInfo)list[m];
var xd_path = "";
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow reader = ds.Tables[0].Rows[i];
if (row.FullName.IndexOfEx(reader["localPath"].ToString()) < 0)
{
continue;
}
xd_path = row.FullName.Replace(reader["localPath"].ToString(), "", true).Trim('\\');
break;
}
var new_id = 0;
ryCommon.sType.FileTime new_file_dt =null;
var new_file_path = "";
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow reader = ds.Tables[0].Rows[i];
var same_file = reader["localPath"].ToString() + "\\" + xd_path;
if (RyFiles.FileOrDirExist(same_file))
{
var dt = RyFiles.GetFileDate(same_file);
if (new_file_dt == null) { new_id = reader["id"].ToInt(); new_file_path = same_file; new_file_dt = dt; }
else
{
if (dt.LastWriteTime > new_file_dt.LastWriteTime) { new_id = reader["id"].ToInt(); new_file_path = same_file; new_file_dt = dt; }
else if (dt.CreateTime > new_file_dt.CreateTime) { new_id = reader["id"].ToInt(); new_file_path = same_file; new_file_dt = dt; }
}
}
}
if(new_file_path.Length>0)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow reader = ds.Tables[0].Rows[i];
if (reader["id"].ToInt() == new_id) { continue; }
var same_file = reader["localPath"].ToString() + "\\" + xd_path;
var is_update = false;
if (RyFiles.FileOrDirExist(same_file))
{
var dt = RyFiles.GetFileDate(same_file);
if (dt.LastWriteTime < new_file_dt.LastWriteTime) { is_update = true; }
else if (dt.CreateTime < new_file_dt.CreateTime) { is_update = true; }
}
else
{
is_update = true;
}
if(is_update)
{
if (RyFiles.CopyFileOrFolder(new_file_path, same_file) != 0)
{
MessageBox.Show("复制到以下位置出错\r\n" + same_file, "复制出错", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
}
}
}
}
ds?.Dispose();
}
db.Free();
this.Invoke(new Action(() =>
{
this.Enabled = true;
UpdateNode(TreeDir.SelectedNode);
}));
}
//olvFiles.RemoveObjects(del_list);
}
}
//private void FileSystemWatcher1_Created(object sender, FileSystemEventArgs e)
//{
// if(CurFolderPath.Length>0 && e.FullPath.IndexOfEx(CurFolderPath)>=0)

View File

@ -47,7 +47,12 @@ namespace 开发辅助工具
{
if(dockPanel1.ActiveContent is FrmWebGet frm)
{
var clip_text = Clipboard.GetText();
var clip_text = "";
try
{
clip_text = Clipboard.GetText();
}
catch { }
var ClipChanged = false;
if (clip_text != Itrycn_Db.last_clip_text)
{
@ -58,17 +63,24 @@ namespace 开发辅助工具
{
if(Itrycn_Db.last_clip_text.IndexOfEx("qurl://") >= 0)
{
switch (MessageBox.Show("是否确定要导入配置?\r\n\r\n" + Itrycn_Db.last_clip_text, "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
new Thread(Start).Start();
void Start()
{
case DialogResult.Yes:
Focus();
frm.ToolStripMenuItem.PerformClick();
Focus();
break;
default:
frm.BringToFront();
Focus();
break;
this.Invoke(new Action(() =>
{
switch (MessageBox.Show("是否确定要导入配置?\r\n\r\n" + Itrycn_Db.last_clip_text, "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.Yes:
Focus();
frm.ToolStripMenuItem.PerformClick();
Focus();
break;
default:
frm.BringToFront();
Focus();
break;
}
}));
}
}
}

View File

@ -0,0 +1,141 @@
namespace SuperDesign.Manager
{
partial class FrmClearInfo
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.labelTx1 = new ryControls.LabelTx();
this.BtnCancel = new ryControls.ButtonEx();
this.BtnOK = new ryControls.ButtonEx();
this.ChkClearCookies = new System.Windows.Forms.CheckBox();
this.ChkClearHeader = new System.Windows.Forms.CheckBox();
this.ChkClearReferer = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// labelTx1
//
this.labelTx1.LineDistance = 5;
this.labelTx1.Location = new System.Drawing.Point(12, 9);
this.labelTx1.Name = "labelTx1";
this.labelTx1.Size = new System.Drawing.Size(263, 19);
this.labelTx1.TabIndex = 6;
this.labelTx1.Text = "你修改了新Url,是否要清空以下内容?";
//
// BtnCancel
//
this.BtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.BtnCancel.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.BtnCancel.Location = new System.Drawing.Point(179, 136);
this.BtnCancel.Name = "BtnCancel";
this.BtnCancel.Size = new System.Drawing.Size(96, 33);
this.BtnCancel.TabIndex = 7;
this.BtnCancel.Text = "取消";
this.BtnCancel.UseVisualStyleBackColor = true;
this.BtnCancel.Click += new System.EventHandler(this.BtnCancel_Click);
//
// BtnOK
//
this.BtnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.BtnOK.BaseColor = System.Drawing.Color.Green;
this.BtnOK.ColorGradient = true;
this.BtnOK.Location = new System.Drawing.Point(77, 136);
this.BtnOK.Name = "BtnOK";
this.BtnOK.Size = new System.Drawing.Size(96, 33);
this.BtnOK.TabIndex = 8;
this.BtnOK.Text = "清空选定";
this.BtnOK.UseDefSkin = false;
this.BtnOK.UseVisualStyleBackColor = true;
this.BtnOK.Click += new System.EventHandler(this.BtnOK_Click);
//
// ChkClearCookies
//
this.ChkClearCookies.AutoSize = true;
this.ChkClearCookies.Checked = true;
this.ChkClearCookies.CheckState = System.Windows.Forms.CheckState.Checked;
this.ChkClearCookies.Location = new System.Drawing.Point(33, 46);
this.ChkClearCookies.Name = "ChkClearCookies";
this.ChkClearCookies.Size = new System.Drawing.Size(90, 16);
this.ChkClearCookies.TabIndex = 9;
this.ChkClearCookies.Text = "清空Cookies";
this.ChkClearCookies.UseVisualStyleBackColor = true;
//
// ChkClearHeader
//
this.ChkClearHeader.AutoSize = true;
this.ChkClearHeader.Checked = true;
this.ChkClearHeader.CheckState = System.Windows.Forms.CheckState.Checked;
this.ChkClearHeader.Location = new System.Drawing.Point(33, 68);
this.ChkClearHeader.Name = "ChkClearHeader";
this.ChkClearHeader.Size = new System.Drawing.Size(84, 16);
this.ChkClearHeader.TabIndex = 10;
this.ChkClearHeader.Text = "清空Header";
this.ChkClearHeader.UseVisualStyleBackColor = true;
//
// ChkClearReferer
//
this.ChkClearReferer.AutoSize = true;
this.ChkClearReferer.Checked = true;
this.ChkClearReferer.CheckState = System.Windows.Forms.CheckState.Checked;
this.ChkClearReferer.Location = new System.Drawing.Point(33, 90);
this.ChkClearReferer.Name = "ChkClearReferer";
this.ChkClearReferer.Size = new System.Drawing.Size(84, 16);
this.ChkClearReferer.TabIndex = 11;
this.ChkClearReferer.Text = "清空引用页";
this.ChkClearReferer.UseVisualStyleBackColor = true;
//
// FrmClearInfo
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(287, 181);
this.Controls.Add(this.ChkClearReferer);
this.Controls.Add(this.ChkClearHeader);
this.Controls.Add(this.ChkClearCookies);
this.Controls.Add(this.BtnOK);
this.Controls.Add(this.BtnCancel);
this.Controls.Add(this.labelTx1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmClearInfo";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "清空";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public ryControls.LabelTx labelTx1;
private ryControls.ButtonEx BtnCancel;
private ryControls.ButtonEx BtnOK;
public System.Windows.Forms.CheckBox ChkClearCookies;
public System.Windows.Forms.CheckBox ChkClearHeader;
public System.Windows.Forms.CheckBox ChkClearReferer;
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SuperDesign.Manager
{
public partial class FrmClearInfo : Form
{
public FrmClearInfo()
{
InitializeComponent();
}
private void BtnOK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void BtnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.2501.2701")]
[assembly: AssemblyFileVersion("3.0.2501.2701")]
[assembly: AssemblyVersion("3.0.2503.3001")]
[assembly: AssemblyFileVersion("3.0.2503.3001")]

View File

@ -153,6 +153,12 @@
<Compile Include="Manager\FrmAddVar.Designer.cs">
<DependentUpon>FrmAddVar.cs</DependentUpon>
</Compile>
<Compile Include="Manager\FrmClearInfo.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Manager\FrmClearInfo.Designer.cs">
<DependentUpon>FrmClearInfo.cs</DependentUpon>
</Compile>
<Compile Include="Manager\FrmSetting.cs">
<SubType>Form</SubType>
</Compile>
@ -391,6 +397,9 @@
<EmbeddedResource Include="Manager\FrmAddVar.resx">
<DependentUpon>FrmAddVar.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Manager\FrmClearInfo.resx">
<DependentUpon>FrmClearInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Manager\FrmSetting.resx">
<DependentUpon>FrmSetting.cs</DependentUpon>
</EmbeddedResource>

View File

@ -88,6 +88,7 @@
"ASCII",
"Unicode"});
this.CbbEncodingCode.Location = new System.Drawing.Point(817, 2);
this.CbbEncodingCode.MaxUndoRedoSteps = 50;
this.CbbEncodingCode.Name = "CbbEncodingCode";
this.CbbEncodingCode.Size = new System.Drawing.Size(121, 22);
this.CbbEncodingCode.TabIndex = 19;
@ -228,7 +229,6 @@
this.TxtFromCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.TxtFromCode.DetectUrls = false;
this.TxtFromCode.EmptyText = "请填写待转换的内容";
this.TxtFromCode.Font = new System.Drawing.Font("Courier New", 10F);
this.TxtFromCode.ForeColor = System.Drawing.Color.Black;
@ -259,7 +259,6 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.TxtResultCode.BackColor = System.Drawing.Color.White;
this.TxtResultCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.TxtResultCode.DetectUrls = false;
this.TxtResultCode.EmptyText = "转换好后的内容";
this.TxtResultCode.Font = new System.Drawing.Font("Courier New", 10F);
this.TxtResultCode.ForeColor = System.Drawing.Color.Black;
@ -321,6 +320,7 @@
this.Name = "FrmEncode";
this.TabPageContextMenuStrip = this.menuRight1;
this.Text = "编码解码";
this.Load += new System.EventHandler(this.FrmEncode_Load);
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -12,7 +12,6 @@ using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Xml;
using WeifenLuo.WinFormsUI.Docking;
namespace .Tools
{
public partial class FrmEncode : DockContent
@ -354,5 +353,8 @@ namespace 开发辅助工具.Tools
}
AutoCode();
}
private void FrmEncode_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -1607,7 +1607,7 @@ namespace 开发辅助工具.Tools
var lines = rich.Lines;
var line_index = rich.GetLineFromCharIndex(rich.SelectionStart);
if (line_index < 0) { line_index = 0; }
if (lines[line_index].Trim().Length==0)
if (lines.Length==0 || lines[line_index].Trim().Length==0)
{
var iPos = rich.GetFirstCharIndexFromLine(line_index);
rich.SelectionStart = iPos;
@ -1662,7 +1662,15 @@ namespace 开发辅助工具.Tools
{
var line = lines[i1];
var stype = line.GetStr("[","]");
if(line.StartsWith("#### ")){ break; }
if(line.StartsWith("#### ")){
rich.SelectionStart = rich.GetFirstCharIndexFromLine(i1);
rich.SelectionLength = 0;
rich.SelectedText = "*.[" + name + "]\n";
rich.SelectionStart--;
//lines.Insert(find_line, "*.[" + name + "]");
match = true;
break;
}
if (stype.Length > 0)
{
dict_line[stype] = i1;
@ -1709,7 +1717,16 @@ namespace 开发辅助工具.Tools
{
if (dict_line.ContainsKey("新增"))
{
rich.SelectionStart = rich.GetFirstCharIndexFromLine(dict_line["新增"] + 1);
var ii = rich.GetFirstCharIndexFromLine(dict_line["新增"] + 1);
if (ii == -1)
{
rich.Text += "\n";
rich.SelectionStart = rich.Text.Length+1;
}
else
{
rich.SelectionStart = ii;
}
rich.SelectionLength = 0;
rich.SelectedText = "*.[" + name + "]\n";
rich.SelectionStart--;
@ -1718,7 +1735,16 @@ namespace 开发辅助工具.Tools
}
else
{
rich.SelectionStart = rich.GetFirstCharIndexFromLine(line_index);
var ii = rich.GetFirstCharIndexFromLine(line_index);
if (ii == -1)
{
rich.Text += "\n";
rich.SelectionStart = rich.Text.Length + 1;
}
else
{
rich.SelectionStart = ii;
}
rich.SelectionLength = 0;
rich.SelectedText = "*.[" + name + "]\n";
rich.SelectionStart--;

View File

@ -52,7 +52,7 @@
this.TxtCookie = new ryControls.Controls.RichTextBox2();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.TxtInputHeader = new ryControls.Controls.RichTextBox2();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupAdvanced = new System.Windows.Forms.GroupBox();
this.CbbContentType = new ryControls.ComboBoxEx2();
this.CbbUserAgent = new ryControls.ComboBoxEx2();
this.CbbReferer = new ryControls.TextBoxEx2();
@ -98,6 +98,7 @@
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.RbWebSocket = new System.Windows.Forms.RadioButton();
this.tabControl2.SuspendLayout();
this.tabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@ -110,7 +111,7 @@
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage7.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupAdvanced.SuspendLayout();
this.groupBox1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.objectListView2)).BeginInit();
@ -429,24 +430,24 @@
this.TxtInputHeader.TextChanged += new System.EventHandler(this.TxtInputHeader_TextChanged);
this.TxtInputHeader.DoubleClick += new System.EventHandler(this.TxtCookie_DoubleClick);
//
// groupBox2
// groupAdvanced
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.groupAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.CbbContentType);
this.groupBox2.Controls.Add(this.CbbUserAgent);
this.groupBox2.Controls.Add(this.CbbReferer);
this.groupBox2.Controls.Add(this.CbbIp);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.label11);
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Location = new System.Drawing.Point(10, 90);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(887, 75);
this.groupBox2.TabIndex = 106;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "高级配置";
this.groupAdvanced.Controls.Add(this.CbbContentType);
this.groupAdvanced.Controls.Add(this.CbbUserAgent);
this.groupAdvanced.Controls.Add(this.CbbReferer);
this.groupAdvanced.Controls.Add(this.CbbIp);
this.groupAdvanced.Controls.Add(this.label6);
this.groupAdvanced.Controls.Add(this.label7);
this.groupAdvanced.Controls.Add(this.label11);
this.groupAdvanced.Controls.Add(this.label8);
this.groupAdvanced.Location = new System.Drawing.Point(10, 90);
this.groupAdvanced.Name = "groupAdvanced";
this.groupAdvanced.Size = new System.Drawing.Size(887, 75);
this.groupAdvanced.TabIndex = 106;
this.groupAdvanced.TabStop = false;
this.groupAdvanced.Text = "高级配置";
//
// CbbContentType
//
@ -463,7 +464,7 @@
this.CbbContentType.Name = "CbbContentType";
this.CbbContentType.SelectedIndex = -1;
this.CbbContentType.SelectedItem = null;
this.CbbContentType.Size = new System.Drawing.Size(218, 23);
this.CbbContentType.Size = new System.Drawing.Size(228, 23);
this.CbbContentType.TabIndex = 304;
this.CbbContentType.ToolTipText = "";
//
@ -474,13 +475,13 @@
this.CbbUserAgent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(239)))), ((int)(((byte)(244)))));
this.CbbUserAgent.ButtonRoundBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(239)))), ((int)(((byte)(244)))));
this.CbbUserAgent.EmptyText = "";
this.CbbUserAgent.Location = new System.Drawing.Point(374, 18);
this.CbbUserAgent.Location = new System.Drawing.Point(386, 18);
this.CbbUserAgent.MaxPopupHeight = 0;
this.CbbUserAgent.MaxPopupWidth = 0;
this.CbbUserAgent.Name = "CbbUserAgent";
this.CbbUserAgent.SelectedIndex = -1;
this.CbbUserAgent.SelectedItem = null;
this.CbbUserAgent.Size = new System.Drawing.Size(506, 23);
this.CbbUserAgent.Size = new System.Drawing.Size(494, 23);
this.CbbUserAgent.TabIndex = 303;
this.toolTip1.SetToolTip(this.CbbUserAgent, "assdddddd");
this.CbbUserAgent.ToolTipText = "";
@ -493,7 +494,7 @@
this.CbbReferer.BackColor = System.Drawing.Color.White;
this.CbbReferer.EmptyText = "引用页(可选)";
this.CbbReferer.ImeMode = System.Windows.Forms.ImeMode.Close;
this.CbbReferer.Location = new System.Drawing.Point(374, 46);
this.CbbReferer.Location = new System.Drawing.Point(386, 46);
this.CbbReferer.LongTime = 2000;
this.CbbReferer.MaxLength = 999999999;
this.CbbReferer.MaxUndoRedoSteps = 50;
@ -505,7 +506,7 @@
this.CbbReferer.SelectedText = "";
this.CbbReferer.SelectionLength = 0;
this.CbbReferer.SelectionStart = 0;
this.CbbReferer.Size = new System.Drawing.Size(506, 23);
this.CbbReferer.Size = new System.Drawing.Size(494, 23);
this.CbbReferer.TabIndex = 302;
this.CbbReferer.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.CbbReferer.ToolTip = "";
@ -528,7 +529,7 @@
this.CbbIp.SelectedText = "";
this.CbbIp.SelectionLength = 0;
this.CbbIp.SelectionStart = 0;
this.CbbIp.Size = new System.Drawing.Size(218, 23);
this.CbbIp.Size = new System.Drawing.Size(228, 23);
this.CbbIp.TabIndex = 301;
this.CbbIp.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.CbbIp.ToolTip = "";
@ -546,7 +547,7 @@
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(310, 24);
this.label7.Location = new System.Drawing.Point(321, 24);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(59, 12);
this.label7.TabIndex = 2;
@ -555,7 +556,7 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(312, 50);
this.label11.Location = new System.Drawing.Point(321, 50);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(47, 12);
this.label11.TabIndex = 0;
@ -725,7 +726,7 @@
// RbPost
//
this.RbPost.AutoSize = true;
this.RbPost.Location = new System.Drawing.Point(629, 10);
this.RbPost.Location = new System.Drawing.Point(577, 10);
this.RbPost.Name = "RbPost";
this.RbPost.Size = new System.Drawing.Size(47, 16);
this.RbPost.TabIndex = 103;
@ -737,7 +738,7 @@
//
this.RbGet.AutoSize = true;
this.RbGet.Checked = true;
this.RbGet.Location = new System.Drawing.Point(582, 10);
this.RbGet.Location = new System.Drawing.Point(530, 10);
this.RbGet.Name = "RbGet";
this.RbGet.Size = new System.Drawing.Size(41, 16);
this.RbGet.TabIndex = 102;
@ -815,19 +816,20 @@
this.TxtUrl.SelectedText = "";
this.TxtUrl.SelectionLength = 0;
this.TxtUrl.SelectionStart = 0;
this.TxtUrl.Size = new System.Drawing.Size(505, 23);
this.TxtUrl.Size = new System.Drawing.Size(456, 23);
this.TxtUrl.TabIndex = 110;
this.TxtUrl.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtUrl.ToolTip = "";
this.TxtUrl.WordWrap = true;
this.TxtUrl.TextChanged2 += new System.EventHandler(this.TxtUrl_TextChanged2);
this.TxtUrl.Enter += new System.EventHandler(this.TxtUrl_Enter);
this.TxtUrl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtUrl_KeyDown);
this.TxtUrl.Leave += new System.EventHandler(this.TxtUrl_Leave);
//
// BtnRunHtml
//
this.BtnRunHtml.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.BtnRunHtml.Location = new System.Drawing.Point(735, 6);
this.BtnRunHtml.Location = new System.Drawing.Point(764, 6);
this.BtnRunHtml.Name = "BtnRunHtml";
this.BtnRunHtml.Size = new System.Drawing.Size(82, 26);
this.BtnRunHtml.TabIndex = 104;
@ -889,7 +891,7 @@
this.BtnShare.Image = ((System.Drawing.Image)(resources.GetObject("BtnShare.Image")));
this.BtnShare.ImageDomain = null;
this.BtnShare.ImageResFolder = null;
this.BtnShare.Location = new System.Drawing.Point(849, 11);
this.BtnShare.Location = new System.Drawing.Point(878, 11);
this.BtnShare.Name = "BtnShare";
this.BtnShare.Size = new System.Drawing.Size(20, 18);
this.BtnShare.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@ -904,7 +906,7 @@
this.BtnSetting.Image = ((System.Drawing.Image)(resources.GetObject("BtnSetting.Image")));
this.BtnSetting.ImageDomain = null;
this.BtnSetting.ImageResFolder = null;
this.BtnSetting.Location = new System.Drawing.Point(823, 11);
this.BtnSetting.Location = new System.Drawing.Point(852, 11);
this.BtnSetting.Name = "BtnSetting";
this.BtnSetting.Size = new System.Drawing.Size(20, 18);
this.BtnSetting.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@ -919,7 +921,7 @@
this.BtnMore.Image = ((System.Drawing.Image)(resources.GetObject("BtnMore.Image")));
this.BtnMore.ImageDomain = null;
this.BtnMore.ImageResFolder = null;
this.BtnMore.Location = new System.Drawing.Point(556, 8);
this.BtnMore.Location = new System.Drawing.Point(504, 8);
this.BtnMore.Name = "BtnMore";
this.BtnMore.Size = new System.Drawing.Size(20, 18);
this.BtnMore.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@ -931,7 +933,7 @@
// RbHead
//
this.RbHead.AutoSize = true;
this.RbHead.Location = new System.Drawing.Point(682, 10);
this.RbHead.Location = new System.Drawing.Point(630, 10);
this.RbHead.Name = "RbHead";
this.RbHead.Size = new System.Drawing.Size(47, 16);
this.RbHead.TabIndex = 115;
@ -983,11 +985,23 @@
this.ToolStripMenuItem.Text = "导入别人的分享链接";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// RbWebSocket
//
this.RbWebSocket.AutoSize = true;
this.RbWebSocket.Location = new System.Drawing.Point(682, 10);
this.RbWebSocket.Name = "RbWebSocket";
this.RbWebSocket.Size = new System.Drawing.Size(77, 16);
this.RbWebSocket.TabIndex = 118;
this.RbWebSocket.Text = "WebSocket";
this.RbWebSocket.UseVisualStyleBackColor = true;
this.RbWebSocket.CheckedChanged += new System.EventHandler(this.RbWebSocket_CheckedChanged);
//
// FrmWebGet
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(909, 620);
this.Controls.Add(this.RbWebSocket);
this.Controls.Add(this.BtnShare);
this.Controls.Add(this.BtnSetting);
this.Controls.Add(this.RbHead);
@ -995,7 +1009,7 @@
this.Controls.Add(this.BtnMore);
this.Controls.Add(this.TxtUrl);
this.Controls.Add(this.tabControl2);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupAdvanced);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.BtnRunHtml);
this.Controls.Add(this.RbPost);
@ -1023,8 +1037,8 @@
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage7.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupAdvanced.ResumeLayout(false);
this.groupAdvanced.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
@ -1046,7 +1060,7 @@
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.TabPage tabPage6;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupAdvanced;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label11;
@ -1107,5 +1121,6 @@
private ryControls.TextBoxEx2 CbbReferer;
private ryControls.ComboBoxEx2 CbbUserAgent;
private ryControls.ComboBoxEx2 CbbContentType;
private System.Windows.Forms.RadioButton RbWebSocket;
}
}

View File

@ -33,6 +33,7 @@ using SuperDesign.Tools;
using ScintillaNETV2.Highlight;
using System.Runtime.InteropServices;
using WinShell;
using System.Net.WebSockets;
namespace .Tools
{
@ -240,19 +241,21 @@ namespace 开发辅助工具.Tools
RichHeader.Text = "";
RichStatus.Text = "";
extendedWebBrowser1.LoadStrings("");
if (TxtUrl.Text.IndexOfEx("//") == 0)
if (!RbWebSocket.Checked)
{
TxtUrl.Text = "http:" + TxtUrl.Text;
if (TxtUrl.Text.IndexOfEx("//") == 0)
{
TxtUrl.Text = "http:" + TxtUrl.Text;
}
else if (TxtUrl.Text.IndexOfEx("://") == 0)
{
TxtUrl.Text = "http" + TxtUrl.Text;
}
else if (TxtUrl.Text.IndexOfEx("http") != 0 && TxtUrl.Text.IndexOfEx("ws:/") != 0)
{
TxtUrl.Text = "http://" + TxtUrl.Text.TrimStart('/');
}
}
else if (TxtUrl.Text.IndexOfEx("://") == 0)
{
TxtUrl.Text = "http" + TxtUrl.Text;
}
else if (TxtUrl.Text.IndexOfEx("http") != 0)
{
TxtUrl.Text = "http://" + TxtUrl.Text.TrimStart('/');
}
string str = GetMethod();
var PostData = this.TxtPost.Text.Trim();
if (str == "head") { PostData = ""; }
@ -267,6 +270,7 @@ namespace 开发辅助工具.Tools
{
}
}
HttpItem item = new HttpItem
{
URL = TxtUrl.Text.Trim(),
@ -349,13 +353,46 @@ namespace 开发辅助工具.Tools
}
th = new Thread(Start);
th.Start();
void Start()
async void Start()
{
try
{
var http = new HttpHelper();
DateTime dt = DateTime.Now;
var result = http.GetHtml(item);
HttpResult result;
if (str == "websocket")
{
result = new HttpResult();
try
{
using (var client = new ClientWebSocket())
{
await client.ConnectAsync(new Uri(item.URL), CancellationToken.None);
Console.WriteLine("WebSocket connected.");
var encoding = item.Encoding == null ? Encoding.UTF8 : item.Encoding;
var buffer = encoding.GetBytes(item.Postdata);
await client.SendAsync(new ArraySegment<byte>(buffer), WebSocketMessageType.Text, true, CancellationToken.None);
//Console.WriteLine("Message sent.");
var receiveBuffer = new byte[1024];
WebSocketReceiveResult result2 = await client.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
string response = encoding.GetString(receiveBuffer, 0, result2.Count);
//Console.WriteLine("Received: " + response);
await client.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None);
result.StatusCode = System.Net.HttpStatusCode.OK;
result.Html = response;
// Console.WriteLine("WebSocket closed.");
}
}
catch (Exception ex)
{
result.StatusCode = System.Net.HttpStatusCode.BadRequest;
result.Html = ex.Message;
}
}
else
{
result = http.GetHtml(item);
}
DateTime dt_end = DateTime.Now;
if (result.StatusCode == System.Net.HttpStatusCode.OK)
{
@ -364,142 +401,167 @@ namespace 开发辅助工具.Tools
string api_name = "";
try
{
uri = new Uri(item.URL);
var host = uri.Host.ToLower();
if(!System.IO.File.Exists(Application.StartupPath+ "\\SysDb\\webicons\\"+host+".png") &&
!System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + host + ".ico"))
if (item.Method != "websocket")
{
var img = RyImage.LoadPic(uri.Scheme+"://"+uri.Host+ "/favicon.ico");
if(img!=null)
uri = new Uri(item.URL);
var host = uri.Host.ToLower();
var icon_name = host + (uri.Port == 80 ? "" : ("_" + uri.Port));
if (!System.IO.File.Exists(Application.StartupPath + "\\SysDb\\webicons\\" + icon_name + ".png") &&
!System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + icon_name + ".ico"))
{
img.Save(Application.StartupPath + "\\UserDb\\webicons\\" + host + ".ico");
}
}
if (host.IndexOfEx("www.87g") == 0 || host.IndexOfEx("www.3h3") == 0
|| host.IndexOfEx("www.downxia") == 0 || host.IndexOfEx("www.downbank") == 0 || host.IndexOfEx("www.downxing") == 0 || host.IndexOfEx("downwn.com") == 0)
{
if (str=="get")
{
api_url = "<site>" + uri.AbsolutePath;
}
else
{
api_url = "<site>" + uri.PathAndQuery;
}
var urlparam = RyWeb.WebDecode.UrlToData(uri.OriginalString);
api_name = urlparam.Get("a");
if (api_name.Length == 0)
{
api_name = urlparam.Get("api");
}
}
else
{
if (str == "get")
{
api_url = uri.Scheme + "://" + uri.Host + (uri.Port == 80 ? "" : (":" + uri.Port)) + uri.AbsolutePath;
}
else
{
api_url = uri.OriginalString;
}
}
Dictionary<string, string> dict_urlpost = new Dictionary<string, string>();
if (!item.Postdata.StartsWith("{"))
{
var post = RyWeb.WebDecode.UrlToData(str == "get" ? uri.OriginalString : ("f?" + item.Postdata));
if (post.Item2 != null)
{
dict_urlpost = post.Item2.ToDictionary(item2 => item2.Key, item2 => item2.Value);
}
}
if (dict_urlpost.Count > 0)
{
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
bool is_update = false;
RyQuickSQL mySQL = new RyQuickSQL("api");
mySQL.AddField("Url", api_url);
DataSet ds = db.ReadData("select * from api where Url=@Url", mySQL);
var json_post = "";
if (ds.HaveData())
var img = RyImage.LoadPic(uri.Scheme + "://" + uri.Host + (uri.Port == 80 ? "" : (":" + uri.Port)) + "/favicon.ico");
if (img == null)
{
var row = ds.GetFirstRowData();
json_post = row["Postdata"].ToString();
is_update = true;
mySQL.AddField("ClickCount", row["ClickCount"].ToInt() + 1);//点击次数
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
htmlDoc.LoadHtml(result.Html);
var icon_url = htmlDoc.DocumentNode.SelectSingleNode("//link[@rel='icon']/@href")?.Attributes["href"]?.Value;
if (icon_url == null)
{
icon_url = htmlDoc.DocumentNode.SelectSingleNode("//link[@rel='shortcut icon']/@href")?.Attributes["href"]?.Value;
}
if (icon_url != null)
{
RyWeb.QuickWeb web = new RyWeb.QuickWeb();
var img_url = web.ConvertUrl(icon_url, item.URL);
img = RyImage.LoadPic(img_url);
}
}
if (img != null)
{
try
{
RyFiles.CreateDirectory(Application.StartupPath + "\\UserDb\\webicons");
img.Save(Application.StartupPath + "\\UserDb\\webicons\\" + icon_name + ".ico");
}
catch { }
}
}
if (host.IndexOfEx("www.87g") == 0 || host.IndexOfEx("www.3h3") == 0
|| host.IndexOfEx("www.downxia") == 0 || host.IndexOfEx("www.downbank") == 0 || host.IndexOfEx("www.downxing") == 0 || host.IndexOfEx("downwn.com") == 0)
{
if (str == "get")
{
api_url = "<site>" + uri.AbsolutePath;
}
else
{
mySQL.AddField("Name", "");
mySQL.AddField("APIName", api_name);
mySQL.AddField("addTime", DateTime.Now);
mySQL.AddField("AddUser", "robot");
api_url = "<site>" + uri.PathAndQuery;
}
mySQL.AddField("editTime", DateTime.Now);
JObject jo;
if (json_post.Length == 0) { jo = new JObject(); }
else { jo = JObject.Parse(json_post); }
Dictionary<string, PostInfo> dict_post = new Dictionary<string, PostInfo>();
if (jo.ContainsKey("list"))
var urlparam = RyWeb.WebDecode.UrlToData(uri.OriginalString);
api_name = urlparam.Get("a");
if (api_name.Length == 0)
{
JArray jarr = JArray.Parse(jo["list"].ToString());
for (int i = 0; i < jarr.Count; i++)
api_name = urlparam.Get("api");
}
}
else
{
if (str == "get")
{
api_url = uri.Scheme + "://" + uri.Host + (uri.Port == 80 ? "" : (":" + uri.Port)) + uri.AbsolutePath;
}
else
{
api_url = uri.OriginalString;
}
}
Dictionary<string, string> dict_urlpost = new Dictionary<string, string>();
if (!item.Postdata.StartsWith("{"))
{
var post = RyWeb.WebDecode.UrlToData(str == "get" ? uri.OriginalString : ("f?" + item.Postdata));
if (post.Item2 != null)
{
dict_urlpost = post.Item2.ToDictionary(item2 => item2.Key, item2 => item2.Value);
}
}
if (dict_urlpost.Count > 0)
{
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
bool is_update = false;
RyQuickSQL mySQL = new RyQuickSQL("api");
mySQL.AddField("Url", api_url);
DataSet ds = db.ReadData("select * from api where Url=@Url", mySQL);
var json_post = "";
if (ds.HaveData())
{
var item_jarr = jarr[i];
var param_name = item_jarr["paramname"].ToString();
dict_post[param_name] = new PostInfo()
{
Title = item_jarr["title"].ToString(),
ParamName = param_name,
Desc = item_jarr["desc"].ToString(),
};
var row = ds.GetFirstRowData();
json_post = row["Postdata"].ToString();
is_update = true;
mySQL.AddField("ClickCount", row["ClickCount"].ToInt() + 1);//点击次数
}
foreach (var item2 in dict_urlpost)
else
{
if (!dict_post.ContainsKey(item2.Key))
mySQL.AddField("Name", "");
mySQL.AddField("APIName", api_name);
mySQL.AddField("addTime", DateTime.Now);
mySQL.AddField("AddUser", "robot");
}
mySQL.AddField("editTime", DateTime.Now);
JObject jo;
if (json_post.Length == 0) { jo = new JObject(); }
else { jo = JObject.Parse(json_post); }
Dictionary<string, PostInfo> dict_post = new Dictionary<string, PostInfo>();
if (jo.ContainsKey("list"))
{
JArray jarr = JArray.Parse(jo["list"].ToString());
for (int i = 0; i < jarr.Count; i++)
{
JObject jo_item = new JObject
var item_jarr = jarr[i];
var param_name = item_jarr["paramname"].ToString();
dict_post[param_name] = new PostInfo()
{
Title = item_jarr["title"].ToString(),
ParamName = param_name,
Desc = item_jarr["desc"].ToString(),
};
}
foreach (var item2 in dict_urlpost)
{
if (!dict_post.ContainsKey(item2.Key))
{
JObject jo_item = new JObject
{
{ "paramname", item2.Key },
{ "title", APIManager.GetParamTitle(item2.Key) },
{ "paramvalue", item2.Value },
{ "desc", "" }
};
jarr.Add(jo_item);
jarr.Add(jo_item);
}
}
jo["list"] = jarr;
}
jo["list"] = jarr;
}
else
{
JArray jarr_new = new JArray();
foreach (var item2 in dict_urlpost)
else
{
JObject jo_item = new JObject
JArray jarr_new = new JArray();
foreach (var item2 in dict_urlpost)
{
JObject jo_item = new JObject
{
{ "paramname", item2.Key },
{ "title",APIManager.GetParamTitle(item2.Key) },
{ "paramvalue", item2.Value },
{ "desc", "" }
};
jarr_new.Add(jo_item);
jarr_new.Add(jo_item);
}
jo.Add("list", jarr_new);
}
mySQL.AddField("Postdata", jo.ToString());
if (is_update)
{
db.ExecuteNonQuery(mySQL.GetUpdateSQL() + " where Url=@Url", mySQL);
}
else
{
db.Insert(mySQL);
}
jo.Add("list", jarr_new);
}
mySQL.AddField("Postdata", jo.ToString());
if (is_update)
{
db.ExecuteNonQuery(mySQL.GetUpdateSQL() + " where Url=@Url", mySQL);
}
else
{
db.Insert(mySQL);
}
}
db.Free();
}
db.Free();
}
}
catch(Exception ex) { MessageBox.Show(ex.Message); }
@ -696,6 +758,7 @@ namespace 开发辅助工具.Tools
private Image ByteArrayToImage(byte[] Bytes)
{
if (Bytes == null) { return null; }
MemoryStream stream = new MemoryStream(Bytes);
return Image.FromStream(stream, true);
}
@ -736,6 +799,7 @@ namespace 开发辅助工具.Tools
}
}
ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
TxtPost.Enabled = false;
}
private bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
@ -814,17 +878,19 @@ namespace 开发辅助工具.Tools
mySQL.AddField("Cookie", TxtCookie.Text);
mySQL.AddField("Postdata", TxtPost.Text);
mySQL.AddField("Header", TxtInputHeader.Text);
var method = "";
if (RbHead.Checked)
var method = GetMethod();
mySQL.AddField("Method", method);
if (CbbUserAgent.SelectedIndex != -1)
{
method="head";
if (CbbUserAgent.SelectedItem is ComboPopupItem info)
{
mySQL.AddField("UserAgent", info.ValueStr1);
}
}
else
{
method= RbGet.Checked ? "get" : "post";
mySQL.AddField("UserAgent", CbbUserAgent.Text);
}
mySQL.AddField("Method", method);
mySQL.AddField("UserAgent", CbbUserAgent.Text);
mySQL.AddField("Referer", CbbReferer.Text);
mySQL.AddField("ContentType", CbbContentType.Text);
mySQL.AddField("Encoding", CbbEncoding.Text);
@ -912,6 +978,10 @@ namespace 开发辅助工具.Tools
{
RbHead.Checked = true;
}
else if (row["Method"].ToString() == "websocket")
{
RbWebSocket.Checked = true;
}
else { RbGet.Checked = true; }
}
void SetValueByRich(ryControls.Controls.RichTextBox2 txt, string Field)
@ -942,6 +1012,18 @@ namespace 开发辅助工具.Tools
}
if (!have)
{
for (int i = 0; i < cbb.Items.Count; i++)
{
if (cbb.Items[i] is ComboPopupItem item2)
{
if (item2.Text == row[Field].ToString())
{
cbb.SelectedIndex = i;
have = true;
break;
}
}
}
cbb.Text = row[Field].ToString();
}
}
@ -1010,25 +1092,26 @@ namespace 开发辅助工具.Tools
try
{
var uri = new Uri(row["Url"].ToString());
if(dict_icon.ContainsKey(uri.Host))
var icon_name = uri.Host + (uri.Port == 80 ? "" : ("_" + uri.Port));
if (dict_icon.ContainsKey(icon_name))
{
icon=dict_icon[uri.Host];
icon=dict_icon[icon_name];
}
else
{
if (System.IO.File.Exists(Application.StartupPath + "\\SysDb\\webicons\\" + uri.Host + ".png"))
if (System.IO.File.Exists(Application.StartupPath + "\\SysDb\\webicons\\" + icon_name + ".png"))
{
icon = RyImage.LoadPic(Application.StartupPath + "\\SysDb\\webicons\\" + uri.Host + ".png");
icon = RyImage.LoadPic(Application.StartupPath + "\\SysDb\\webicons\\" + icon_name + ".png");
}
else if (System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + uri.Host + ".ico"))
else if (System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + icon_name + ".ico"))
{
icon = RyImage.LoadPic(Application.StartupPath + "\\UserDb\\webicons\\" + uri.Host + ".ico");
icon = RyImage.LoadPic(Application.StartupPath + "\\UserDb\\webicons\\" + icon_name + ".ico");
}
else if (System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + uri.Host + ".png"))
else if (System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + icon_name + ".png"))
{
icon = RyImage.LoadPic(Application.StartupPath + "\\UserDb\\webicons\\" + uri.Host + ".png");
icon = RyImage.LoadPic(Application.StartupPath + "\\UserDb\\webicons\\" + icon_name + ".png");
}
dict_icon[uri.Host] = icon;
dict_icon[icon_name] = icon;
}
}
catch { }
@ -1061,25 +1144,26 @@ namespace 开发辅助工具.Tools
try
{
var uri = new Uri(row["Url"].ToString());
if (dict_icon.ContainsKey(uri.Host))
var icon_name = uri.Host + (uri.Port == 80 ? "" : ("_" + uri.Port));
if (dict_icon.ContainsKey(icon_name))
{
icon = dict_icon[uri.Host];
icon = dict_icon[icon_name];
}
else
{
if (System.IO.File.Exists(Application.StartupPath + "\\SysDb\\webicons\\" + uri.Host + ".png"))
if (System.IO.File.Exists(Application.StartupPath + "\\SysDb\\webicons\\" + icon_name + ".png"))
{
icon = RyImage.LoadPic(Application.StartupPath + "\\SysDb\\webicons\\" + uri.Host + ".png");
icon = RyImage.LoadPic(Application.StartupPath + "\\SysDb\\webicons\\" + icon_name + ".png");
}
else if (System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + uri.Host + ".ico"))
else if (System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + icon_name + ".ico"))
{
icon = RyImage.LoadPic(Application.StartupPath + "\\UserDb\\webicons\\" + uri.Host + ".ico");
icon = RyImage.LoadPic(Application.StartupPath + "\\UserDb\\webicons\\" + icon_name + ".ico");
}
else if (System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + uri.Host + ".png"))
else if (System.IO.File.Exists(Application.StartupPath + "\\UserDb\\webicons\\" + icon_name + ".png"))
{
icon = RyImage.LoadPic(Application.StartupPath + "\\UserDb\\webicons\\" + uri.Host + ".png");
icon = RyImage.LoadPic(Application.StartupPath + "\\UserDb\\webicons\\" +icon_name + ".png");
}
dict_icon[uri.Host] = icon;
dict_icon[icon_name] = icon;
}
}
catch { }
@ -1132,34 +1216,33 @@ namespace 开发辅助工具.Tools
{
if (IsAddNewUrl && !objectListView2.Visible)
{
if (TxtCookie.Text.Length > 0 && TxtInputHeader.Text.Length > 0)
var is_show = TxtCookie.Text.Length > 0 || TxtInputHeader.Text.Length > 0 || TxtInputHeader.Text.Length > 0;
if(is_show)
{
if (MessageBox.Show("你修改了新Url,是否要清空Cookie和Header", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
FrmClearInfo frm = new FrmClearInfo();
frm.Icon = this.Icon;
frm.ChkClearCookies.Enabled = TxtCookie.Text.Length > 0;
frm.ChkClearHeader.Enabled = TxtInputHeader.Text.Length > 0;
frm.ChkClearReferer.Enabled = CbbReferer.Text.Length > 0;
if (frm.ShowDialog() == DialogResult.OK)
{
TxtCookie.Text = "";
TxtInputHeader.Text = "";
}
}
else if (TxtCookie.Text.Length > 0)
{
if (MessageBox.Show("你修改了新Url,是否要清空Cookie", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
{
TxtCookie.Text = "";
}
}
else if (TxtInputHeader.Text.Length > 0)
{
if (MessageBox.Show("你修改了新Url,是否要清空Header", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
{
TxtInputHeader.Text = "";
}
}
if (CbbReferer.Text.Length > 0)
{
if (MessageBox.Show("你修改了新Url,是否要清空引用页?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
{
CbbReferer.Text = "";
if (frm.ChkClearCookies.Checked)
{
TxtCookie.Text = "";
tabPage2.Text = "Cookie";
}
if (frm.ChkClearHeader.Checked)
{
TxtInputHeader.Text = "";
tabPage7.Text = "Header";
}
if (frm.ChkClearReferer.Checked)
{
CbbReferer.Text = "";
}
}
frm.Dispose();
IsAddNewUrl = false;
}
}
if (!objectListView2.Focused)
@ -1549,7 +1632,7 @@ namespace 开发辅助工具.Tools
private void RbGet_CheckedChanged(object sender, EventArgs e)
{
if(RbGet.Checked) TxtPost.Enabled = false;
if(RbGet.Checked) TxtPost.Enabled = false;
}
private void RbPost_CheckedChanged(object sender, EventArgs e)
@ -1741,6 +1824,10 @@ namespace 开发辅助工具.Tools
{
str = "head";
}
if (RbWebSocket.Checked)
{
str = "websocket";
}
return str;
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
@ -1824,6 +1911,7 @@ namespace 开发辅助工具.Tools
if (Method == "get") { RbGet.Checked = true; }
else if (Method == "post") { RbPost.Checked = true; }
else if (Method == "head") { RbHead.Checked = true; }
else if (Method == "websocket") { RbWebSocket.Checked = true; }
else { RbGet.Checked = true; }
TxtUrl.Text = json_set.GetJsonValue("Url", "");
IsAddNewUrl = false;
@ -1835,7 +1923,36 @@ namespace 开发辅助工具.Tools
ChkNoPreview.Checked = json_set.GetJsonValue("NoPreview_On", true);
ChkHtmlPreview.Checked = json_set.GetJsonValue("HtmlPreview_On", false);
CbbContentType.Text = json_set.GetJsonValue("ContentType", "");
CbbUserAgent.Text = json_set.GetJsonValue("UserAgent", "");
var UserAgent = json_set.GetJsonValue("UserAgent", "");
var find = false;
for (int i = 0; i < CbbUserAgent.Items.Count; i++)
{
if(CbbUserAgent.Items[i] is ComboPopupItem info)
{
if(info.Text.ToLower()== UserAgent.ToLower())
{
CbbUserAgent.SelectedIndex = i;
find = true;
break;
}
else if(info.ValueStr1.ToLower() == UserAgent.ToLower())
{
CbbUserAgent.SelectedIndex = i;
find = true;
break;
}
else if(info.Text=="IE9浏览器" && UserAgent== "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)")
{
CbbUserAgent.SelectedIndex = i;
find = true;
break;
}
}
}
if(!find)
{
CbbUserAgent.Text = UserAgent;
}
CbbIp.Text = json_set.GetJsonValue("Ip", "");
CbbReferer.Text = json_set.GetJsonValue("Referer", "");
TxtPost.Text = json_set.GetJsonValue("Post", "");
@ -1974,6 +2091,27 @@ namespace 开发辅助工具.Tools
CbbUserAgent.ToolTipText = CbbUserAgent.Text;
}
}
private void RbWebSocket_CheckedChanged(object sender, EventArgs e)
{
if (RbWebSocket.Checked) TxtPost.Enabled = true;
groupAdvanced.Enabled = !RbWebSocket.Checked;
TxtCookie.Enabled = !RbWebSocket.Checked;
TxtInputHeader.Enabled = !RbWebSocket.Checked;
ChkGetPic.Enabled = !RbWebSocket.Checked;
ChkNoPreview.Enabled = !RbWebSocket.Checked;
ChkJump.Enabled = !RbWebSocket.Checked;
CbbTimeout.Enabled = !RbWebSocket.Checked;
CbbWriteTimeout.Enabled = !RbWebSocket.Checked;
}
private void TxtUrl_Enter(object sender, EventArgs e)
{
if (TxtUrl.Text.Length==0)
{
TxtUrl_TextChanged2(TxtUrl, e);
}
}
}
public class UrlInfo
{

View File

@ -129,6 +129,9 @@
<metadata name="MenuMore.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>306, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>423, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="BtnShare.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>