修复了BUG,更新了组件V1.0.1版,提供了很多功能

This commit is contained in:
hsl20
2017-03-04 17:07:26 +08:00
parent e2fd8a7b29
commit d277f6a289
18 changed files with 797 additions and 60 deletions

View File

@@ -42,6 +42,7 @@
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -52,7 +53,6 @@
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.listBox1 = new System.Windows.Forms.ListBox();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
@@ -117,31 +117,38 @@
// 版本控制ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "版本控制ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(152, 26);
this.ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.ToolStripMenuItem.Text = "版本控制";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 维护切换ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "维护切换ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(152, 26);
this.ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.ToolStripMenuItem.Text = "维护切换";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 消息发送ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "消息发送ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(152, 26);
this.ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.ToolStripMenuItem.Text = "消息发送";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 一键断开ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "一键断开ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(152, 26);
this.ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.ToolStripMenuItem.Text = "一键断开";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 账户管理ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "账户管理ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.ToolStripMenuItem.Text = "账户管理";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 关于ToolStripMenuItem
//
this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -233,16 +240,10 @@
this.listBox1.ItemHeight = 17;
this.listBox1.Location = new System.Drawing.Point(10, 60);
this.listBox1.Name = "listBox1";
this.listBox1.SelectionMode = System.Windows.Forms.SelectionMode.None;
this.listBox1.Size = new System.Drawing.Size(216, 344);
this.listBox1.TabIndex = 8;
//
// 账户管理ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "账户管理ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(152, 26);
this.ToolStripMenuItem.Text = "账户管理";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);

View File

@@ -130,12 +130,17 @@ namespace 软件系统服务端模版
fm.Dispose();
MaintenanceInitialization();
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
//测试发送字节数据
//net_socket_server.SendAllClients(BitConverter.GetBytes(12345678));
//将消息群发给所有的客户端,并使用消息弹窗的方式显示
FormInputAndAction fiaa = new FormInputAndAction(m =>{
net_socket_server.SendAllClients(CommonHeadCode.MultiNetHeadCode. + m); return true;});
FormInputAndAction fiaa = new FormInputAndAction(m =>
{
net_socket_server.SendAllClients(CommonHeadCode.MultiNetHeadCode. + m); return true;
});
fiaa.ShowDialog();
fiaa.Dispose();
}
@@ -149,10 +154,8 @@ namespace 软件系统服务端模版
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
BasicFramework.FormAbout fm = new BasicFramework.FormAbout(
"您的软件名称",
UserServer.ServerSettings.SystemVersion,
2017,
"某某某");
CommonLibrary.Resource.StringResouce.SoftName, UserServer.ServerSettings.SystemVersion,
2017, CommonLibrary.Resource.StringResouce.SoftCopyRight);
fm.ShowDialog();
fm.Dispose();
}
@@ -360,6 +363,11 @@ namespace 软件系统服务端模版
net_soft_update_Server.log_record.ClearLogText();
net_simplify_server.SendMessage(object1, "成功");
}
else if (head_code == CommonHeadCode.SimplifyHeadCode.)
{
bool result = UserServer.ServerAccounts.AddNewAccount(object2.Substring(4));
net_simplify_server.SendMessage(object1, result ? "1" : "0");
}
else
{
net_simplify_server.SendMessage(object1, object2);
@@ -397,7 +405,8 @@ namespace 软件系统服务端模版
{
//如果此处充斥大量if语句影响观感则考虑进行指令头分类操作客户端异步发送的字符串都会到此处处理
string head_code = object2.Substring(0, 4);
byte[] result = Convert.FromBase64String(object2.Substring(4));
}
private void Net_socket_server_AcceptByte(HuTcpState object1, byte[] object2)
@@ -447,6 +456,6 @@ namespace 软件系统服务端模版
#endregion
private Log_Record log = new Log_Record();
}
}

View File

@@ -53,18 +53,12 @@ namespace 软件系统服务端模版
public class UserAccountEx : UserAccount
{
/// <summary>
/// 示例,扩展一个手机号的属性
/// 用户的年龄
/// </summary>
public string Phone { get; set; } = "";
public override void DeepCopy<T>(T account)
{
base.DeepCopy<T>(account);
UserAccountEx accountex = account as UserAccountEx;
if (accountex != null)
{
//所有新增的属性在此进行复制
accountex.Phone = Phone;
}
}
public int Age { get; set; } = 0;
/// <summary>
/// 用户的家庭住址
/// </summary>
public string HomeAddress { get; set; } = "";
}
}