From e24bfbcee159ccb45f8675abc83a8fa7493095f5 Mon Sep 17 00:00:00 2001 From: HSL Date: Fri, 7 Apr 2017 09:08:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=85=B1=E4=BA=AB=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E8=B0=83=E8=AF=95=E6=88=90=E5=8A=9F=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=BA=86=E6=96=87=E4=BB=B6=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=EF=BC=8C=E5=8F=AF=E4=BB=A5=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0=EF=BC=8C=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=E5=8F=8A=E4=B8=8A=E4=BC=A0=E4=BA=BA=E6=9D=A5=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 软件系统客户端模版/FormMainWindow.Designer.cs | 30 +++++++++---------- 软件系统客户端模版/FormMainWindow.cs | 8 +++-- .../UIControls/ShareFilesRender.cs | 16 +++++++--- 软件系统服务端模版/Form1.cs | 2 +- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/软件系统客户端模版/FormMainWindow.Designer.cs b/软件系统客户端模版/FormMainWindow.Designer.cs index 02e6b2d..6a7acce 100644 --- a/软件系统客户端模版/FormMainWindow.Designer.cs +++ b/软件系统客户端模版/FormMainWindow.Designer.cs @@ -146,7 +146,7 @@ this.关于ToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(921, 35); + this.menuStrip1.Size = new System.Drawing.Size(921, 33); this.menuStrip1.TabIndex = 1; this.menuStrip1.Text = "menuStrip1"; // @@ -159,41 +159,41 @@ this.远程更新ToolStripMenuItem, this.注册账号ToolStripMenuItem}); this.管理员ToolStripMenuItem.Name = "管理员ToolStripMenuItem"; - this.管理员ToolStripMenuItem.Size = new System.Drawing.Size(84, 31); + this.管理员ToolStripMenuItem.Size = new System.Drawing.Size(84, 29); this.管理员ToolStripMenuItem.Text = "管理员"; // // 更改公告ToolStripMenuItem // this.更改公告ToolStripMenuItem.Name = "更改公告ToolStripMenuItem"; - this.更改公告ToolStripMenuItem.Size = new System.Drawing.Size(164, 32); + this.更改公告ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.更改公告ToolStripMenuItem.Text = "更改公告"; this.更改公告ToolStripMenuItem.Click += new System.EventHandler(this.更改公告ToolStripMenuItem_Click); // // 日志查看ToolStripMenuItem // this.日志查看ToolStripMenuItem.Name = "日志查看ToolStripMenuItem"; - this.日志查看ToolStripMenuItem.Size = new System.Drawing.Size(164, 32); + this.日志查看ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.日志查看ToolStripMenuItem.Text = "日志查看"; this.日志查看ToolStripMenuItem.Click += new System.EventHandler(this.日志查看ToolStripMenuItem_Click); // // 账户管理ToolStripMenuItem // this.账户管理ToolStripMenuItem.Name = "账户管理ToolStripMenuItem"; - this.账户管理ToolStripMenuItem.Size = new System.Drawing.Size(164, 32); + this.账户管理ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.账户管理ToolStripMenuItem.Text = "账户管理"; this.账户管理ToolStripMenuItem.Click += new System.EventHandler(this.账户管理ToolStripMenuItem_Click); // // 远程更新ToolStripMenuItem // this.远程更新ToolStripMenuItem.Name = "远程更新ToolStripMenuItem"; - this.远程更新ToolStripMenuItem.Size = new System.Drawing.Size(164, 32); + this.远程更新ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.远程更新ToolStripMenuItem.Text = "远程更新"; this.远程更新ToolStripMenuItem.Click += new System.EventHandler(this.远程更新ToolStripMenuItem_Click); // // 注册账号ToolStripMenuItem // this.注册账号ToolStripMenuItem.Name = "注册账号ToolStripMenuItem"; - this.注册账号ToolStripMenuItem.Size = new System.Drawing.Size(164, 32); + this.注册账号ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.注册账号ToolStripMenuItem.Text = "注册账号"; this.注册账号ToolStripMenuItem.Click += new System.EventHandler(this.注册账号ToolStripMenuItem_Click); // @@ -202,13 +202,13 @@ this.设置ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.修改密码ToolStripMenuItem}); this.设置ToolStripMenuItem.Name = "设置ToolStripMenuItem"; - this.设置ToolStripMenuItem.Size = new System.Drawing.Size(64, 31); + this.设置ToolStripMenuItem.Size = new System.Drawing.Size(64, 29); this.设置ToolStripMenuItem.Text = "设置"; // // 修改密码ToolStripMenuItem // this.修改密码ToolStripMenuItem.Name = "修改密码ToolStripMenuItem"; - this.修改密码ToolStripMenuItem.Size = new System.Drawing.Size(164, 32); + this.修改密码ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.修改密码ToolStripMenuItem.Text = "修改密码"; this.修改密码ToolStripMenuItem.Click += new System.EventHandler(this.修改密码ToolStripMenuItem_Click); // @@ -219,27 +219,27 @@ this.更新日志ToolStripMenuItem, this.版本号说明ToolStripMenuItem}); this.关于ToolStripMenuItem.Name = "关于ToolStripMenuItem"; - this.关于ToolStripMenuItem.Size = new System.Drawing.Size(64, 31); + this.关于ToolStripMenuItem.Size = new System.Drawing.Size(64, 29); this.关于ToolStripMenuItem.Text = "关于"; // // 关于本软件ToolStripMenuItem // this.关于本软件ToolStripMenuItem.Name = "关于本软件ToolStripMenuItem"; - this.关于本软件ToolStripMenuItem.Size = new System.Drawing.Size(184, 32); + this.关于本软件ToolStripMenuItem.Size = new System.Drawing.Size(184, 30); this.关于本软件ToolStripMenuItem.Text = "关于本软件"; this.关于本软件ToolStripMenuItem.Click += new System.EventHandler(this.关于本软件ToolStripMenuItem_Click); // // 更新日志ToolStripMenuItem // this.更新日志ToolStripMenuItem.Name = "更新日志ToolStripMenuItem"; - this.更新日志ToolStripMenuItem.Size = new System.Drawing.Size(184, 32); + this.更新日志ToolStripMenuItem.Size = new System.Drawing.Size(184, 30); this.更新日志ToolStripMenuItem.Text = "更新日志"; this.更新日志ToolStripMenuItem.Click += new System.EventHandler(this.更新日志ToolStripMenuItem_Click); // // 版本号说明ToolStripMenuItem // this.版本号说明ToolStripMenuItem.Name = "版本号说明ToolStripMenuItem"; - this.版本号说明ToolStripMenuItem.Size = new System.Drawing.Size(184, 32); + this.版本号说明ToolStripMenuItem.Size = new System.Drawing.Size(184, 30); this.版本号说明ToolStripMenuItem.Text = "版本号说明"; this.版本号说明ToolStripMenuItem.Click += new System.EventHandler(this.版本号说明ToolStripMenuItem_Click); // @@ -267,9 +267,9 @@ this.panel1.Controls.Add(this.label1); this.panel1.Dock = System.Windows.Forms.DockStyle.Right; this.panel1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.panel1.Location = new System.Drawing.Point(697, 35); + this.panel1.Location = new System.Drawing.Point(697, 33); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(224, 419); + this.panel1.Size = new System.Drawing.Size(224, 421); this.panel1.TabIndex = 2; // // label_file_count diff --git a/软件系统客户端模版/FormMainWindow.cs b/软件系统客户端模版/FormMainWindow.cs index d08073a..12fea56 100644 --- a/软件系统客户端模版/FormMainWindow.cs +++ b/软件系统客户端模版/FormMainWindow.cs @@ -19,6 +19,7 @@ using System.Threading; // 版权所有 胡少林 // 授权说明 模版仅授权个人使用,如需商用,请联系hsl200909@163.com洽谈 // 说明 JSON组件引用自james newton-king,遵循MIT授权协议 +// 说明 文件的图标来源于http://fileicons.chromefans.org/,感谢作者的无私分享 //============================================================================ @@ -282,10 +283,10 @@ namespace 软件系统客户端模版 //收到服务器的数据 JObject json = JObject.Parse(object2.Substring(4)); UserClient.DateTimeServer = json["Time"].ToObject(); - label_file_count.Text = json["FileCount"].ToObject().ToString(); if (IsHandleCreated) Invoke(new Action(() => { toolStripStatusLabel_time.Text = UserClient.DateTimeServer.ToString("yyyy-MM-dd HH:mm"); + label_file_count.Text = json["FileCount"].ToObject().ToString(); })); } else if(head_code==CommonHeadCode.MultiNetHeadCode.文件数量) @@ -373,9 +374,10 @@ namespace 软件系统客户端模版 UIControls_Files = new UIControls.ShareFilesRender() { - Parent = this, - Dock = DockStyle.Fill, + Parent = this,//决定了放在哪个界面显示,此处仅仅是测试 Visible = true, + Location = new Point(100, 100), + //Dock = DockStyle.Fill, }; all_main_render.Add(UIControls_Files); } diff --git a/软件系统客户端模版/UIControls/ShareFilesRender.cs b/软件系统客户端模版/UIControls/ShareFilesRender.cs index 1eb9fa4..9b77218 100644 --- a/软件系统客户端模版/UIControls/ShareFilesRender.cs +++ b/软件系统客户端模版/UIControls/ShareFilesRender.cs @@ -17,6 +17,8 @@ namespace 软件系统客户端模版.UIControls public ShareFilesRender() { InitializeComponent(); + + DoubleBuffered = true; } private void userButton_upload_Click(object sender, EventArgs e) @@ -78,11 +80,14 @@ namespace 软件系统客户端模版.UIControls } }); panel2.Controls.Add(item); + item.BackColor = Color.White; + item.BorderStyle = BorderStyle.FixedSingle; + item.SetFile(m, () => m.UploadName == UserClient.UserAccount.UserName); item.Location = new Point(2, location_y); - item.Size = new Size(panel2.Width - 20, item.Size.Height); + item.Size = new Size(panel2.Width - 4, item.Size.Height); item.Anchor = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right); - location_y += item.Height + 2; + location_y += item.Height + 4; FilesControls.Push(item); } } @@ -121,10 +126,13 @@ namespace 软件系统客户端模版.UIControls private void textBox1_TextChanged(object sender, EventArgs e) { //搜索时触发的数据 - if(string.IsNullOrEmpty(textBox1.Text)) + if(!string.IsNullOrEmpty(textBox1.Text)) { string pattern = textBox1.Text; - SetFilesShow(Cache_Files.Where(f => f.FileName.Contains(pattern) || f.FileNote.Contains(pattern)).ToList()); + SetFilesShow(Cache_Files.Where(f => + f.FileName.Contains(pattern) || + f.FileNote.Contains(pattern) || + f.UploadName.Contains(pattern)).ToList()); } else { diff --git a/软件系统服务端模版/Form1.cs b/软件系统服务端模版/Form1.cs index d5fe0ad..6e6c872 100644 --- a/软件系统服务端模版/Form1.cs +++ b/软件系统服务端模版/Form1.cs @@ -19,7 +19,6 @@ using Newtonsoft.Json.Linq; // 版权所有 胡少林 // 授权说明 模版仅授权个人使用,如需商用,请联系hsl200909@163.com洽谈 // 说明 JSON组件引用自james newton-king,遵循MIT授权协议 -// 说明 文件的图标来源于,感谢作者的无私分享 //============================================================================ @@ -546,6 +545,7 @@ namespace 软件系统服务端模版 str => JArray.Parse(str).ToObject>()); //文件信息存储路径 net_simple_file_server.FileSavePath = Application.StartupPath + @"\files.txt"; + net_simple_file_server.ReadFromFile(); //文件存储路径 net_simple_file_server.File_save_path = Application.StartupPath + @"\Files"; net_simple_file_server.FileChange += Net_simple_file_server_FileChange;