网络组件优化,共享文件管理新增日志管理,详细记录文件上传下载删除信息。

This commit is contained in:
dathlin
2017-06-04 19:13:26 +08:00
parent ef482761bc
commit 1ad48587d4
6 changed files with 73 additions and 12 deletions

View File

@@ -45,6 +45,8 @@ namespace CommonLibrary
public static string { get; } = "B006"; public static string { get; } = "B006";
public static string { get; } = "B007"; public static string { get; } = "B007";
public static string { get; } = "B008"; public static string { get; } = "B008";
public static string { get; } = "B009";
public static string { get; } = "B010";
/************************************************************************************** /**************************************************************************************
* *

Binary file not shown.

View File

@@ -1116,19 +1116,19 @@
</member> </member>
<member name="M:HslCommunication.BasicFramework.SoftLogHelper.SaveInformation(System.String)"> <member name="M:HslCommunication.BasicFramework.SoftLogHelper.SaveInformation(System.String)">
<summary> <summary>
用于内部保存日志内容的方法 用于保存信息级别日志内容的方法
</summary> </summary>
<param name="str"></param> <param name="str"></param>
</member> </member>
<member name="M:HslCommunication.BasicFramework.SoftLogHelper.SaveWarnning(System.String)"> <member name="M:HslCommunication.BasicFramework.SoftLogHelper.SaveWarnning(System.String)">
<summary> <summary>
用于内部保存日志内容的方法 用于保存警告级别日志内容的方法
</summary> </summary>
<param name="str"></param> <param name="str"></param>
</member> </member>
<member name="M:HslCommunication.BasicFramework.SoftLogHelper.SaveError(System.String)"> <member name="M:HslCommunication.BasicFramework.SoftLogHelper.SaveError(System.String)">
<summary> <summary>
用于内部保存日志内容的方法 用于保存错误日志内容的方法
</summary> </summary>
<param name="str"></param> <param name="str"></param>
</member> </member>

View File

@@ -44,6 +44,8 @@ namespace 软件系统客户端模版
this.userButton_log3 = new HslCommunication.Controls.UserButton(); this.userButton_log3 = new HslCommunication.Controls.UserButton();
this.userButton_log4 = new HslCommunication.Controls.UserButton(); this.userButton_log4 = new HslCommunication.Controls.UserButton();
this.userButton_log = new HslCommunication.Controls.UserButton(); this.userButton_log = new HslCommunication.Controls.UserButton();
this.userButton8 = new HslCommunication.Controls.UserButton();
this.userButton9 = new HslCommunication.Controls.UserButton();
this.SuspendLayout(); this.SuspendLayout();
// //
// textBox1 // textBox1
@@ -150,12 +152,12 @@ namespace 软件系统客户端模版
// //
// userButton6 // userButton6
// //
this.userButton6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.userButton6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.userButton6.BackColor = System.Drawing.Color.Transparent; this.userButton6.BackColor = System.Drawing.Color.Transparent;
this.userButton6.CustomerInformation = ""; this.userButton6.CustomerInformation = "";
this.userButton6.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton6.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
this.userButton6.Font = new System.Drawing.Font("微软雅黑", 9F); this.userButton6.Font = new System.Drawing.Font("微软雅黑", 9F);
this.userButton6.Location = new System.Drawing.Point(619, 303); this.userButton6.Location = new System.Drawing.Point(619, 450);
this.userButton6.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.userButton6.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.userButton6.Name = "userButton6"; this.userButton6.Name = "userButton6";
this.userButton6.Size = new System.Drawing.Size(103, 26); this.userButton6.Size = new System.Drawing.Size(103, 26);
@@ -165,12 +167,12 @@ namespace 软件系统客户端模版
// //
// userButton7 // userButton7
// //
this.userButton7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.userButton7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.userButton7.BackColor = System.Drawing.Color.Transparent; this.userButton7.BackColor = System.Drawing.Color.Transparent;
this.userButton7.CustomerInformation = ""; this.userButton7.CustomerInformation = "";
this.userButton7.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton7.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
this.userButton7.Font = new System.Drawing.Font("微软雅黑", 9F); this.userButton7.Font = new System.Drawing.Font("微软雅黑", 9F);
this.userButton7.Location = new System.Drawing.Point(619, 269); this.userButton7.Location = new System.Drawing.Point(619, 416);
this.userButton7.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.userButton7.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.userButton7.Name = "userButton7"; this.userButton7.Name = "userButton7";
this.userButton7.Size = new System.Drawing.Size(103, 26); this.userButton7.Size = new System.Drawing.Size(103, 26);
@@ -180,7 +182,7 @@ namespace 软件系统客户端模版
// //
// userButton_log1 // userButton_log1
// //
this.userButton_log1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.userButton_log1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.userButton_log1.BackColor = System.Drawing.Color.Transparent; this.userButton_log1.BackColor = System.Drawing.Color.Transparent;
this.userButton_log1.CustomerInformation = ""; this.userButton_log1.CustomerInformation = "";
this.userButton_log1.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton_log1.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
@@ -195,7 +197,7 @@ namespace 软件系统客户端模版
// //
// userButton_log2 // userButton_log2
// //
this.userButton_log2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.userButton_log2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.userButton_log2.BackColor = System.Drawing.Color.Transparent; this.userButton_log2.BackColor = System.Drawing.Color.Transparent;
this.userButton_log2.CustomerInformation = ""; this.userButton_log2.CustomerInformation = "";
this.userButton_log2.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton_log2.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
@@ -210,7 +212,7 @@ namespace 软件系统客户端模版
// //
// userButton_log3 // userButton_log3
// //
this.userButton_log3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.userButton_log3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.userButton_log3.BackColor = System.Drawing.Color.Transparent; this.userButton_log3.BackColor = System.Drawing.Color.Transparent;
this.userButton_log3.CustomerInformation = ""; this.userButton_log3.CustomerInformation = "";
this.userButton_log3.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton_log3.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
@@ -225,7 +227,7 @@ namespace 软件系统客户端模版
// //
// userButton_log4 // userButton_log4
// //
this.userButton_log4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.userButton_log4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.userButton_log4.BackColor = System.Drawing.Color.Transparent; this.userButton_log4.BackColor = System.Drawing.Color.Transparent;
this.userButton_log4.CustomerInformation = ""; this.userButton_log4.CustomerInformation = "";
this.userButton_log4.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton_log4.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
@@ -240,7 +242,7 @@ namespace 软件系统客户端模版
// //
// userButton_log // userButton_log
// //
this.userButton_log.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.userButton_log.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.userButton_log.BackColor = System.Drawing.Color.Transparent; this.userButton_log.BackColor = System.Drawing.Color.Transparent;
this.userButton_log.CustomerInformation = ""; this.userButton_log.CustomerInformation = "";
this.userButton_log.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190))))); this.userButton_log.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
@@ -253,11 +255,43 @@ namespace 软件系统客户端模版
this.userButton_log.UIText = "全部"; this.userButton_log.UIText = "全部";
this.userButton_log.Click += new System.EventHandler(this.userButton_log_Click); this.userButton_log.Click += new System.EventHandler(this.userButton_log_Click);
// //
// userButton8
//
this.userButton8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.userButton8.BackColor = System.Drawing.Color.Transparent;
this.userButton8.CustomerInformation = "";
this.userButton8.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
this.userButton8.Font = new System.Drawing.Font("微软雅黑", 9F);
this.userButton8.Location = new System.Drawing.Point(619, 301);
this.userButton8.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.userButton8.Name = "userButton8";
this.userButton8.Size = new System.Drawing.Size(103, 26);
this.userButton8.TabIndex = 20;
this.userButton8.UIText = "共享文件日志清空";
this.userButton8.Click += new System.EventHandler(this.userButton8_Click);
//
// userButton9
//
this.userButton9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.userButton9.BackColor = System.Drawing.Color.Transparent;
this.userButton9.CustomerInformation = "";
this.userButton9.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
this.userButton9.Font = new System.Drawing.Font("微软雅黑", 9F);
this.userButton9.Location = new System.Drawing.Point(619, 267);
this.userButton9.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.userButton9.Name = "userButton9";
this.userButton9.Size = new System.Drawing.Size(103, 26);
this.userButton9.TabIndex = 19;
this.userButton9.UIText = "共享文件日志查看";
this.userButton9.Click += new System.EventHandler(this.userButton9_Click);
//
// FormLog // FormLog
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(732, 512); this.ClientSize = new System.Drawing.Size(732, 512);
this.Controls.Add(this.userButton8);
this.Controls.Add(this.userButton9);
this.Controls.Add(this.userButton_log); this.Controls.Add(this.userButton_log);
this.Controls.Add(this.userButton_log4); this.Controls.Add(this.userButton_log4);
this.Controls.Add(this.userButton_log3); this.Controls.Add(this.userButton_log3);
@@ -299,5 +333,7 @@ namespace 软件系统客户端模版
private UserButton userButton_log3; private UserButton userButton_log3;
private UserButton userButton_log4; private UserButton userButton_log4;
private UserButton userButton_log; private UserButton userButton_log;
private UserButton userButton8;
private UserButton userButton9;
} }
} }

View File

@@ -86,6 +86,15 @@ namespace 软件系统客户端模版
{ {
ClearFromServer(CommonHeadCode.SimplifyHeadCode.); ClearFromServer(CommonHeadCode.SimplifyHeadCode.);
} }
private void userButton9_Click(object sender, EventArgs e)
{
ReadFromServer(CommonHeadCode.SimplifyHeadCode.);
}
private void userButton8_Click(object sender, EventArgs e)
{
ClearFromServer(CommonHeadCode.SimplifyHeadCode.);
}
/// <summary> /// <summary>
/// 查询日志的缓存 /// 查询日志的缓存
@@ -132,5 +141,7 @@ namespace 软件系统客户端模版
{ {
textBox1.Text = LogTemp; textBox1.Text = LogTemp;
} }
} }
} }

View File

@@ -476,6 +476,17 @@ namespace 软件系统服务端模版
net_simplify_server.SendMessage(object1, "成功"); net_simplify_server.SendMessage(object1, "成功");
RuntimeLogHelper.SaveInformation("运行日志清空"); RuntimeLogHelper.SaveInformation("运行日志清空");
} }
else if (headCode == CommonHeadCode.SimplifyHeadCode.)
{
net_simplify_server.SendMessage(object1, net_simple_file_server.LogHelper.GetLogText());
RuntimeLogHelper.SaveInformation("共享文件日志查看");
}
else if (headCode == CommonHeadCode.SimplifyHeadCode.)
{
net_simple_file_server.LogHelper.ClearLogText();
net_simplify_server.SendMessage(object1, "成功");
RuntimeLogHelper.SaveInformation("共享文件日志清空");
}
else else
{ {
net_simplify_server.SendMessage(object1, object2); net_simplify_server.SendMessage(object1, object2);
@@ -700,6 +711,7 @@ namespace 软件系统服务端模版
FileSavePath = Application.StartupPath + @"\files.txt" FileSavePath = Application.StartupPath + @"\files.txt"
}; };
net_simple_file_server.ReadFromFile(); net_simple_file_server.ReadFromFile();
net_simple_file_server.LogHelper.LogSaveFileName = Application.StartupPath + @"\share_file_log.txt";
//文件存储路径 //文件存储路径
net_simple_file_server.File_save_path = Application.StartupPath + @"\Files"; net_simple_file_server.File_save_path = Application.StartupPath + @"\Files";
net_simple_file_server.FileChange += Net_simple_file_server_FileChange; net_simple_file_server.FileChange += Net_simple_file_server_FileChange;