1、 1选题合理、目的明确(10分) 2设计方案正确,具有可行性创新性(20分) 3设计结果(20分) 4态度认真、学习刻苦、遵守纪律(15分) 5设计报告的规范化、参考文献充分(10分) 6答辩(25分)总分(100分)六、建议参考资料计算机网络实验指导书,张建忠,北京:清华大学出版社,2005计算机网络教程题解与实验指导。黄叔武,北京:清华大学出版社,2006目录1、设计背景 - 3 -2、需求分析 - 3 -3、 软件设计框图 - 3 -1、主要控件: - 3 -2、流程图: - 4 -4、核心程序清单 - 5 -5、测试 - 13 -1、程序界面: - 13 -2、启动并运行程序: - 1
2、4 -7、参考文献 - 16 -1、设计背景随着计算机网络日新月异的发展,人们的交流方式越来越多,传统的交流方式,如:信件、电报、电话等已经难以满足人们的交流要求,在互联网上即时的和好友取得联系,已经成为当今社会人们主流的联系方式。因此,两台计算机之间进行即时通讯、发送文件等交流方式已经成为必然潮流。2、需求分析现在虽然出现了等聊天工具,然而等聊天工具虽然方便、实用,但是,娱乐功能太多,有很多吸引人的娱乐功能,从一定程度上来说,是一种娱乐工具,不能作为用于即时通讯、文件共享的专用工具。目前,用于实现单一的即时通讯、文件共享的软件实在太少,而且,它们中大部分都是绝对的C/S模式,对远程服务器有非
3、常大的依赖性,没有彻底实现点对点的交流。为此,我决定开发一个专用于实现两台计算机之间即时通讯的软件,以方便两台计算机之间信息的交流。避免了服务器忙或与服务器无法连接时,浪费过多时间用于和服务器建立连接。因此,这个软件是极具适应性和实用性的即时通讯软件。3、软件设计框图控件类型控件ID主要属性设置用途RichTextBoxrtbContentBorderStyle:None显示聊天信息rtbSend输入信息TextBoxtextIP默认输入对方主机textName输入昵称ButtonbuttonClear清空聊天记录buttonSend发送信息buttonClose退出TimerInterval
4、:1000定时更新受到的信息4、核心程序清单html view plaincopy1 /文件Program.cs 2 using System;3 using System.Collections.Generic;4 using System.Linq;5 using System.Threading.Tasks;6 using System.Windows.Forms;7 8 9 namespace OO 10 11 static class Program 12 13 / 14 / 应用程序的主入口点。15 / 16 STAThread 17 static void Main() 18 1
5、9 Application.EnableVisualStyles();20 Application.SetCompatibleTextRenderingDefault(false);21 Application.Run(new mainForm();22 23 24 25 26 /文件Form1.Designer.cs 27 namespace OO 28 29 partial class mainForm 30 31 / 32 / 必需的设计器变量。33 / 34 private System.ComponentModel.IContainer components = null;35 36
6、 37 / 38 / 清理所有正在使用的资源。39 / 40 / 如果应释放托管资源,为 true;否则为 false。41 protected override void Dispose(bool disposing) 42 43 if (disposing & (components != null) 44 45 components.Dispose();46 47 base.Dispose(disposing);48 49 50 51 #region Windows 窗体设计器生成的代码 52 53 54 / 55 / 设计器支持所需的方法 - 不要 56 / 使用代码编辑器修改此方法的
7、内容。57 / 58 private void InitializeComponent() 59 60 ponents = new System.ComponentModel.Container();61 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainForm);62 this.rtbContent = new System.Windows.Forms.RichTextBox();63 this.rt
8、bSend = new System.Windows.Forms.RichTextBox();64 this.textIP = new System.Windows.Forms.TextBox();65 this.textName = new System.Windows.Forms.TextBox();66 this.butClear = new System.Windows.Forms.Button();67 this.butClose = new System.Windows.Forms.Button();68 this.butSend = new System.Windows.Form
9、s.Button();69 this.timer = new System.Windows.Forms.Timer(ponents);70 this.labelIP = new System.Windows.Forms.Label();71 this.labelName = new System.Windows.Forms.Label();72 this.SuspendLayout();73 / 74 / rtbContent 75 / 76 this.rtbContent.BackColor = System.Drawing.Color.Silver;77 this.rtbContent.B
10、orderStyle = System.Windows.Forms.BorderStyle.None;78 this.rtbContent.Location = new System.Drawing.Point(9, 82);79 this.rtbContent.Name = rtbContent;80 this.rtbContent.Size = new System.Drawing.Size(567, 232);81 this.rtbContent.TabIndex = 0;82 this.rtbContent.Text = 83 / 84 / rtbSend 85 / 86 this.r
11、tbSend.BackColor = System.Drawing.Color.Silver;87 this.rtbSend.BorderStyle = System.Windows.Forms.BorderStyle.None;88 this.rtbSend.Location = new System.Drawing.Point(9, 339);89 this.rtbSend.Name = rtbSend90 this.rtbSend.Size = new System.Drawing.Size(567, 47);91 this.rtbSend.TabIndex = 1;92 this.rt
12、bSend.Text = 93 / 94 / textIP 95 / 96 this.textIP.BackColor = System.Drawing.Color.Silver;97 this.textIP.BorderStyle = System.Windows.Forms.BorderStyle.None;98 this.textIP.Location = new System.Drawing.Point(98, 322);99 this.textIP.Name = textIP100 this.textIP.Size = new System.Drawing.Size(152, 16)
13、;101 this.textIP.TabIndex = 2;102 / 103 / textName 104 / 105 this.textName.BackColor = System.Drawing.Color.Silver;106 this.textName.BorderStyle = System.Windows.Forms.BorderStyle.None;107 this.textName.Location = new System.Drawing.Point(53, 7);108 this.textName.Name = textName109 this.textName.Siz
14、e = new System.Drawing.Size(150, 16);110 this.textName.TabIndex = 3;111 / 112 / butClear 113 / 114 this.butClear.BackColor = System.Drawing.Color.Silver;115 this.butClear.FlatAppearance.BorderSize = 0;116 this.butClear.FlatStyle = System.Windows.Forms.FlatStyle.Popup;117 this.butClear.Location = new
15、 System.Drawing.Point(342, 395);118 this.butClear.Name = butClear119 this.butClear.Size = new System.Drawing.Size(87, 27);120 this.butClear.TabIndex = 4;121 this.butClear.Text = 清屏122 this.butClear.UseVisualStyleBackColor = false;123 this.butClear.Click += new System.EventHandler(this.butClear_Click
16、);124 / 125 / butClose 126 / 127 this.butClose.FlatAppearance.BorderColor = System.Drawing.Color.Silver;128 this.butClose.FlatAppearance.BorderSize = 0;129 this.butClose.FlatStyle = System.Windows.Forms.FlatStyle.Popup;130 this.butClose.Location = new System.Drawing.Point(342, 432);131 this.butClose
17、.Name = butClose132 this.butClose.Size = new System.Drawing.Size(87, 27);133 this.butClose.TabIndex = 5;134 this.butClose.Text = 关闭135 this.butClose.UseVisualStyleBackColor = true;136 this.butClose.Click += new System.EventHandler(this.butClose_Click);137 / 138 / butSend 139 / 140 this.butSend.BackC
18、olor = System.Drawing.Color.Silver;141 this.butSend.FlatAppearance.BorderColor = System.Drawing.Color.Silver;142 this.butSend.FlatAppearance.BorderSize = 0;143 this.butSend.FlatStyle = System.Windows.Forms.FlatStyle.Popup;144 this.butSend.Font = new System.Drawing.Font(楷体, 21.75F, System.Drawing.Fon
19、tStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)(134);145 this.butSend.Location = new System.Drawing.Point(431, 395);146 this.butSend.Name = butSend147 this.butSend.Size = new System.Drawing.Size(145, 64);148 this.butSend.TabIndex = 6;149 this.butSend.Text = 发送150 this.butSend.UseVisualStyl
20、eBackColor = false;151 this.butSend.Click += new System.EventHandler(this.butSend_Click);152 / 153 / timer 154 / 155 this.timer.Interval = 1000;156 this.timer.Tick += new System.EventHandler(this.timer_Tick);157 / 158 / labelIP 159 / 160 this.labelIP.AutoSize = true;161 this.labelIP.Location = new S
21、ystem.Drawing.Point(9, 322);162 this.labelIP.Name = labelIP163 this.labelIP.Size = new System.Drawing.Size(63, 14);164 this.labelIP.TabIndex = 7;165 this.labelIP.Text = 对方主机166 / 167 / labelName 168 / 169 this.labelName.AutoSize = true;170 this.labelName.Location = new System.Drawing.Point(12, 9);17
22、1 this.labelName.Name = labelName172 this.labelName.Size = new System.Drawing.Size(35, 14);173 this.labelName.TabIndex = 8;174 this.labelName.Text = 昵称175 / 176 / mainForm 177 / 178 this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);179 this.AutoScaleMode = System.Windows.Forms.AutoScaleMo
23、de.Font;180 this.BackColor = System.Drawing.Color.Silver;181 this.BackgroundImage = global:OO.Properties.Resources.bg01;182 this.ClientSize = new System.Drawing.Size(588, 471);183 this.Controls.Add(this.labelName);184 this.Controls.Add(this.labelIP);185 this.Controls.Add(this.butSend);186 this.Contr
24、ols.Add(this.butClose);187 this.Controls.Add(this.butClear);188 this.Controls.Add(this.textName);189 this.Controls.Add(this.textIP);190 this.Controls.Add(this.rtbSend);191 this.Controls.Add(this.rtbContent);192 this.Font = new System.Drawing.Font(, 10.5F, System.Drawing.FontStyle.Regular, System.Dra
25、wing.GraphicsUnit.Point, (byte)(134);193 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;194 this.Icon = (System.Drawing.Icon)(resources.GetObject($this.Icon);195 this.MaximizeBox = false;196 this.Name = mainForm197 this.Text = OO198 this.Load += new System.EventHandler(this.
26、mainForm_Load);199 this.ResumeLayout(false);200 this.PerformLayout();201 202 203 204 205 206 #endregion 207 208 209 private System.Windows.Forms.RichTextBox rtbContent;210 private System.Windows.Forms.RichTextBox rtbSend;211 private System.Windows.Forms.TextBox textIP;212 private System.Windows.Form
27、s.TextBox textName;213 private System.Windows.Forms.Button butClear;214 private System.Windows.Forms.Button butClose;215 private System.Windows.Forms.Button butSend;216 private System.Windows.Forms.Timer timer;217 private System.Windows.Forms.Label labelIP;218 private System.Windows.Forms.Label labelName;219 220 221 222 223 224 /文件Form1.cs 225 using System;226 using System.Collections.Generic;227 using System.Comp
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2