一个简单的实时聊天界面测试成功,并未对聊天进行记录
This commit is contained in:
236
软件系统客户端模版/FormMainWindow.Designer.cs
generated
236
软件系统客户端模版/FormMainWindow.Designer.cs
generated
@@ -37,6 +37,18 @@
|
||||
this.toolStripStatusLabel4 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.toolStripStatusLabel_time = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
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();
|
||||
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.panel_right = new System.Windows.Forms.Panel();
|
||||
this.label_file_count = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
@@ -59,20 +71,9 @@
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label_Announcement = new System.Windows.Forms.Label();
|
||||
this.panel_left = new System.Windows.Forms.Panel();
|
||||
this.panel_main = new System.Windows.Forms.Panel();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
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();
|
||||
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.panel_main = new System.Windows.Forms.Panel();
|
||||
this.留言板ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.panel_right.SuspendLayout();
|
||||
@@ -154,6 +155,103 @@
|
||||
this.menuStrip1.TabIndex = 1;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// 管理员ToolStripMenuItem
|
||||
//
|
||||
this.管理员ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.更改公告ToolStripMenuItem,
|
||||
this.日志查看ToolStripMenuItem,
|
||||
this.账户管理ToolStripMenuItem,
|
||||
this.远程更新ToolStripMenuItem,
|
||||
this.注册账号ToolStripMenuItem});
|
||||
this.管理员ToolStripMenuItem.Image = global::软件系统客户端模版.Properties.Resources.Team_32xLG;
|
||||
this.管理员ToolStripMenuItem.Name = "管理员ToolStripMenuItem";
|
||||
this.管理员ToolStripMenuItem.Size = new System.Drawing.Size(100, 31);
|
||||
this.管理员ToolStripMenuItem.Text = "管理员";
|
||||
//
|
||||
// 更改公告ToolStripMenuItem
|
||||
//
|
||||
this.更改公告ToolStripMenuItem.Name = "更改公告ToolStripMenuItem";
|
||||
this.更改公告ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
|
||||
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.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.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.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.Text = "注册账号";
|
||||
this.注册账号ToolStripMenuItem.Click += new System.EventHandler(this.注册账号ToolStripMenuItem_Click);
|
||||
//
|
||||
// 设置ToolStripMenuItem
|
||||
//
|
||||
this.设置ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.修改密码ToolStripMenuItem,
|
||||
this.留言板ToolStripMenuItem});
|
||||
this.设置ToolStripMenuItem.Image = global::软件系统客户端模版.Properties.Resources.PickAxe_32xLG;
|
||||
this.设置ToolStripMenuItem.Name = "设置ToolStripMenuItem";
|
||||
this.设置ToolStripMenuItem.Size = new System.Drawing.Size(80, 31);
|
||||
this.设置ToolStripMenuItem.Text = "设置";
|
||||
//
|
||||
// 修改密码ToolStripMenuItem
|
||||
//
|
||||
this.修改密码ToolStripMenuItem.Name = "修改密码ToolStripMenuItem";
|
||||
this.修改密码ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
|
||||
this.修改密码ToolStripMenuItem.Text = "修改密码";
|
||||
this.修改密码ToolStripMenuItem.Click += new System.EventHandler(this.修改密码ToolStripMenuItem_Click);
|
||||
//
|
||||
// 关于ToolStripMenuItem
|
||||
//
|
||||
this.关于ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.关于本软件ToolStripMenuItem,
|
||||
this.更新日志ToolStripMenuItem,
|
||||
this.版本号说明ToolStripMenuItem});
|
||||
this.关于ToolStripMenuItem.Image = global::软件系统客户端模版.Properties.Resources.ASCube_32xLG;
|
||||
this.关于ToolStripMenuItem.Name = "关于ToolStripMenuItem";
|
||||
this.关于ToolStripMenuItem.Size = new System.Drawing.Size(80, 31);
|
||||
this.关于ToolStripMenuItem.Text = "关于";
|
||||
//
|
||||
// 关于本软件ToolStripMenuItem
|
||||
//
|
||||
this.关于本软件ToolStripMenuItem.Name = "关于本软件ToolStripMenuItem";
|
||||
this.关于本软件ToolStripMenuItem.Size = new System.Drawing.Size(184, 32);
|
||||
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.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.Text = "版本号说明";
|
||||
this.版本号说明ToolStripMenuItem.Click += new System.EventHandler(this.版本号说明ToolStripMenuItem_Click);
|
||||
//
|
||||
// panel_right
|
||||
//
|
||||
this.panel_right.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
@@ -387,14 +485,6 @@
|
||||
this.panel_left.Size = new System.Drawing.Size(140, 419);
|
||||
this.panel_left.TabIndex = 4;
|
||||
//
|
||||
// panel_main
|
||||
//
|
||||
this.panel_main.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel_main.Location = new System.Drawing.Point(140, 35);
|
||||
this.panel_main.Name = "panel_main";
|
||||
this.panel_main.Size = new System.Drawing.Size(557, 419);
|
||||
this.panel_main.TabIndex = 5;
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.Location = new System.Drawing.Point(4, 7);
|
||||
@@ -403,101 +493,20 @@
|
||||
this.label10.TabIndex = 0;
|
||||
this.label10.Text = "左侧边栏,不需要可以隐藏";
|
||||
//
|
||||
// 管理员ToolStripMenuItem
|
||||
// panel_main
|
||||
//
|
||||
this.管理员ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.更改公告ToolStripMenuItem,
|
||||
this.日志查看ToolStripMenuItem,
|
||||
this.账户管理ToolStripMenuItem,
|
||||
this.远程更新ToolStripMenuItem,
|
||||
this.注册账号ToolStripMenuItem});
|
||||
this.管理员ToolStripMenuItem.Image = global::软件系统客户端模版.Properties.Resources.Team_32xLG;
|
||||
this.管理员ToolStripMenuItem.Name = "管理员ToolStripMenuItem";
|
||||
this.管理员ToolStripMenuItem.Size = new System.Drawing.Size(100, 31);
|
||||
this.管理员ToolStripMenuItem.Text = "管理员";
|
||||
this.panel_main.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel_main.Location = new System.Drawing.Point(140, 35);
|
||||
this.panel_main.Name = "panel_main";
|
||||
this.panel_main.Size = new System.Drawing.Size(557, 419);
|
||||
this.panel_main.TabIndex = 5;
|
||||
//
|
||||
// 更改公告ToolStripMenuItem
|
||||
// 留言板ToolStripMenuItem
|
||||
//
|
||||
this.更改公告ToolStripMenuItem.Name = "更改公告ToolStripMenuItem";
|
||||
this.更改公告ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
|
||||
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.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.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.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.Text = "注册账号";
|
||||
this.注册账号ToolStripMenuItem.Click += new System.EventHandler(this.注册账号ToolStripMenuItem_Click);
|
||||
//
|
||||
// 设置ToolStripMenuItem
|
||||
//
|
||||
this.设置ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.修改密码ToolStripMenuItem});
|
||||
this.设置ToolStripMenuItem.Image = global::软件系统客户端模版.Properties.Resources.PickAxe_32xLG;
|
||||
this.设置ToolStripMenuItem.Name = "设置ToolStripMenuItem";
|
||||
this.设置ToolStripMenuItem.Size = new System.Drawing.Size(80, 31);
|
||||
this.设置ToolStripMenuItem.Text = "设置";
|
||||
//
|
||||
// 修改密码ToolStripMenuItem
|
||||
//
|
||||
this.修改密码ToolStripMenuItem.Name = "修改密码ToolStripMenuItem";
|
||||
this.修改密码ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
|
||||
this.修改密码ToolStripMenuItem.Text = "修改密码";
|
||||
this.修改密码ToolStripMenuItem.Click += new System.EventHandler(this.修改密码ToolStripMenuItem_Click);
|
||||
//
|
||||
// 关于ToolStripMenuItem
|
||||
//
|
||||
this.关于ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.关于本软件ToolStripMenuItem,
|
||||
this.更新日志ToolStripMenuItem,
|
||||
this.版本号说明ToolStripMenuItem});
|
||||
this.关于ToolStripMenuItem.Image = global::软件系统客户端模版.Properties.Resources.ASCube_32xLG;
|
||||
this.关于ToolStripMenuItem.Name = "关于ToolStripMenuItem";
|
||||
this.关于ToolStripMenuItem.Size = new System.Drawing.Size(80, 31);
|
||||
this.关于ToolStripMenuItem.Text = "关于";
|
||||
//
|
||||
// 关于本软件ToolStripMenuItem
|
||||
//
|
||||
this.关于本软件ToolStripMenuItem.Name = "关于本软件ToolStripMenuItem";
|
||||
this.关于本软件ToolStripMenuItem.Size = new System.Drawing.Size(184, 32);
|
||||
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.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.Text = "版本号说明";
|
||||
this.版本号说明ToolStripMenuItem.Click += new System.EventHandler(this.版本号说明ToolStripMenuItem_Click);
|
||||
this.留言板ToolStripMenuItem.Name = "留言板ToolStripMenuItem";
|
||||
this.留言板ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
|
||||
this.留言板ToolStripMenuItem.Text = "留言板";
|
||||
this.留言板ToolStripMenuItem.Click += new System.EventHandler(this.留言板ToolStripMenuItem_Click);
|
||||
//
|
||||
// FormMainWindow
|
||||
//
|
||||
@@ -577,6 +586,7 @@
|
||||
private System.Windows.Forms.Panel panel_left;
|
||||
private System.Windows.Forms.Panel panel_main;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.ToolStripMenuItem 留言板ToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -219,6 +219,12 @@ namespace 软件系统客户端模版
|
||||
Close();
|
||||
}
|
||||
|
||||
private void 留言板ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetShowRenderControl(UIControls_Chat);
|
||||
UIControls_Chat?.InputFocus();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 异步网络块
|
||||
@@ -233,7 +239,7 @@ namespace 软件系统客户端模版
|
||||
net_socket_client.EndPointServer = new System.Net.IPEndPoint(
|
||||
System.Net.IPAddress.Parse(UserClient.ServerIp),
|
||||
CommonLibrary.CommonLibrary.Port_Main_Net);
|
||||
net_socket_client.ClientAlias = UserClient.UserAccount.UserName;
|
||||
net_socket_client.ClientAlias = $"{UserClient.UserAccount.UserName} [{UserClient.UserAccount.Factory}]";//标记客户端在线的名称
|
||||
net_socket_client.ClientStart();
|
||||
}
|
||||
catch(Exception ex)
|
||||
@@ -302,7 +308,14 @@ namespace 软件系统客户端模版
|
||||
UserClient.DateTimeServer = Convert.ToDateTime(object2.Substring(4));
|
||||
if (IsHandleCreated) Invoke(new Action(() =>
|
||||
{
|
||||
toolStripStatusLabel_time.Text = UserClient.DateTimeServer.ToString("yyyy-MM-dd HH:mm")+$"({net_socket_client.DelayTime}ms)";
|
||||
toolStripStatusLabel_time.Text = UserClient.DateTimeServer.ToString("yyyy-MM-dd HH:mm") + $"({net_socket_client.DelayTime}ms)";
|
||||
}));
|
||||
}
|
||||
else if (head_code == CommonHeadCode.MultiNetHeadCode.留言消息)
|
||||
{
|
||||
if (IsHandleCreated) Invoke(new Action(() =>
|
||||
{
|
||||
UIControls_Chat?.DealwithReceive(object2.Substring(4));
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -356,6 +369,12 @@ namespace 软件系统客户端模版
|
||||
/// </summary>
|
||||
private UIControls.ShareFilesRender UIControls_Files { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用于聊天的控件
|
||||
/// </summary>
|
||||
private UIControls.OnlineChatRender UIControls_Chat { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -390,6 +409,18 @@ namespace 软件系统客户端模版
|
||||
Dock = DockStyle.Fill,
|
||||
};
|
||||
all_main_render.Add(UIControls_Files);
|
||||
|
||||
UIControls_Chat = new UIControls.OnlineChatRender((m) =>
|
||||
{
|
||||
net_socket_client.Send(CommonHeadCode.MultiNetHeadCode.留言消息 + m);
|
||||
})
|
||||
{
|
||||
Visible = false,
|
||||
Parent = panel_main,//决定了放在哪个界面显示,此处示例
|
||||
Dock = DockStyle.Fill,
|
||||
};
|
||||
all_main_render.Add(UIControls_Chat);
|
||||
|
||||
}
|
||||
|
||||
private void SetShowRenderControl(UserControl control)
|
||||
@@ -421,10 +452,11 @@ namespace 软件系统客户端模版
|
||||
UIControls_Files.UpdateFiles();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,10 @@
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.richTextBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.richTextBox1.Location = new System.Drawing.Point(1, 2);
|
||||
this.richTextBox1.Name = "richTextBox1";
|
||||
this.richTextBox1.ReadOnly = true;
|
||||
this.richTextBox1.Size = new System.Drawing.Size(633, 373);
|
||||
this.richTextBox1.TabIndex = 0;
|
||||
this.richTextBox1.Text = "";
|
||||
@@ -58,6 +60,7 @@
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label1.Location = new System.Drawing.Point(-1, 381);
|
||||
|
||||
@@ -11,20 +11,40 @@ namespace 软件系统客户端模版.UIControls
|
||||
{
|
||||
public partial class OnlineChatRender : UserControl
|
||||
{
|
||||
public OnlineChatRender()
|
||||
public OnlineChatRender(Action<string> send)
|
||||
{
|
||||
InitializeComponent();
|
||||
SendString = send;
|
||||
}
|
||||
|
||||
|
||||
private Action<string> SendString = null;
|
||||
|
||||
private void textBox1_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
//按下Enter键后进行发送数据到服务器
|
||||
|
||||
if(!string.IsNullOrEmpty(textBox1.Text))
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
SendString?.Invoke(textBox1.Text);
|
||||
textBox1.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnlineChatRender_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void DealwithReceive(string str)
|
||||
{
|
||||
richTextBox1.AppendText(str + Environment.NewLine);
|
||||
}
|
||||
|
||||
public void InputFocus()
|
||||
{
|
||||
textBox1.Focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,9 +377,8 @@ namespace 软件系统服务端模版
|
||||
}
|
||||
else if (headCode == CommonHeadCode.SimplifyHeadCode.密码修改)
|
||||
{
|
||||
//更新服务器的账户密码
|
||||
//此处使用的是组件自带的验证的方式,如果使用SQL数据库,另行验证
|
||||
Newtonsoft.Json.Linq.JObject json = Newtonsoft.Json.Linq.JObject.Parse(object2.Substring(4));
|
||||
//更新服务器的账户密码,此处使用的是组件自带的验证的方式,如果使用SQL数据库,另行验证
|
||||
JObject json = JObject.Parse(object2.Substring(4));
|
||||
//提取账户,密码
|
||||
string name = SoftBasic.GetValueFromJsonObject(json, UserAccount.UserNameText, "");
|
||||
string password = SoftBasic.GetValueFromJsonObject(json, UserAccount.PasswordText, "");
|
||||
@@ -519,7 +518,9 @@ namespace 软件系统服务端模版
|
||||
string headCode = object2.Substring(0, 4);
|
||||
if (headCode == CommonHeadCode.MultiNetHeadCode.留言消息)
|
||||
{
|
||||
|
||||
string content = headCode + object1._Login_Alias + DateTime.Now.ToString(" yyyy-MM-dd HH:mm:ss") + Environment.NewLine + object2.Substring(4);
|
||||
//转发所有的客户端,包括发送者
|
||||
net_socket_server.SendAllClients(content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user