您好,登錄后才能下訂單哦!
這篇文章主要講解了“C#實(shí)現(xiàn)網(wǎng)絡(luò)點(diǎn)對(duì)點(diǎn)的詳細(xì)步驟”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“C#實(shí)現(xiàn)網(wǎng)絡(luò)點(diǎn)對(duì)點(diǎn)的詳細(xì)步驟”吧!
C#實(shí)現(xiàn)網(wǎng)絡(luò)點(diǎn)對(duì)點(diǎn)具體步驟:
在了解、掌握了關(guān)鍵問(wèn)題及其解決方法,再實(shí)現(xiàn)用Visual C#實(shí)現(xiàn)網(wǎng)絡(luò)點(diǎn)對(duì)點(diǎn)通訊程序相對(duì)就容易許多,下面是具體的實(shí)現(xiàn)步驟:
1.啟動(dòng)Visual Studio .Net,并新建一個(gè)Visual C#項(xiàng)目,名稱為(Visual C#實(shí)現(xiàn)網(wǎng)絡(luò)點(diǎn)對(duì)點(diǎn)通訊程序)。
2.在Visual Studio .Net集成開(kāi)發(fā)環(huán)境中的(解決方案資源管理器)窗口中,雙擊Form1.cs文件,進(jìn)入Form1.cs文件的編輯界面。
3.在Form1.cs文件的開(kāi)頭,用下列導(dǎo)入命名空間代碼替代系統(tǒng)缺省的導(dǎo)入命名空間代碼。
using System ; using System.Drawing ; using System.Collections ; using System.ComponentModel ; using System.Windows.Forms ; using System.Data ; using System.Net.Sockets ; using System.Net ; using System.IO ; using System.Text ; using System.Threading ;
4.再把Visual Studio.Net的當(dāng)前窗口切換到(Form1.cs(設(shè)計(jì)))窗口,并從(工具箱)中的(Windows窗體組件)選項(xiàng)卡中往窗體中拖入下列組件:
四個(gè)Button組件;二個(gè)ListBox組件;四個(gè)TextBox組件;一個(gè)StatusBar組件;五個(gè)Label組件。并在四個(gè)Button組件拖入窗體后,分別在窗體設(shè)計(jì)界面中雙擊它們,則系統(tǒng)會(huì)在Form1.cs文件中分別產(chǎn)生這四個(gè)組件的Click事件對(duì)應(yīng)的處理代碼。
5.在(解決方案資源管理器)窗口中,雙擊Form1.cs文件,進(jìn)入Form1.cs文件的編輯界面。以下面代碼替代系統(tǒng)產(chǎn)生的InitializeComponent過(guò)程。下面代碼是對(duì)上面添加的組件進(jìn)行初始化:
private void InitializeComponent ( ) { this.listBox1 = new System.Windows.Forms.ListBox ( ) ; this.textBox1 = new System.Windows.Forms.TextBox ( ) ; this.label3 = new System.Windows.Forms.Label ( ) ; this.label2 = new System.Windows.Forms.Label ( ) ; this.textBox3 = new System.Windows.Forms.TextBox ( ) ; this.button1 = new System.Windows.Forms.Button ( ) ; this.textBox2 = new System.Windows.Forms.TextBox ( ) ; this.label1 = new System.Windows.Forms.Label ( ) ; this.label4 = new System.Windows.Forms.Label ( ) ; this.label5 = new System.Windows.Forms.Label ( ) ; this.button2 = new System.Windows.Forms.Button ( ) ; this.button3 = new System.Windows.Forms.Button ( ) ; this.button4 = new System.Windows.Forms.Button ( ) ; this.textBox4 = new System.Windows.Forms.TextBox ( ) ; this.statusBar1 = new System.Windows.Forms.StatusBar ( ) ; this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel( ); this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel( ); this.label6 = new System.Windows.Forms.Label ( ) ; this.listBox2 = new System.Windows.Forms.ListBox ( ) ; ( ( System.ComponentModel.ISupportInitialize ) ( this.statusBarPanel1 ) ).BeginInit ( ) ; ( ( System.ComponentModel.ISupportInitialize ) ( this.statusBarPanel2 ) ).BeginInit ( ) ; this.SuspendLayout ( ) ; this.listBox1.ItemHeight = 12 ; this.listBox1.Location = new System.Drawing.Point ( 122 , 110 ) ; this.listBox1.Name = "listBox1" ; this.listBox1.Size = new System.Drawing.Size ( 212 , 88 ) ; this.listBox1.TabIndex = 4 ; this.textBox1.Location = new System.Drawing.Point ( 122 , 18 ) ; this.textBox1.Name = "textBox1" ; this.textBox1.Size = new System.Drawing.Size ( 210 , 21 ) ; this.textBox1.TabIndex = 1 ; this.textBox1.Text = "" ; this.label3.Location = new System.Drawing.Point ( 220 , 52 ) ; this.label3.Na
感謝各位的閱讀,以上就是“C#實(shí)現(xiàn)網(wǎng)絡(luò)點(diǎn)對(duì)點(diǎn)的詳細(xì)步驟”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)C#實(shí)現(xiàn)網(wǎng)絡(luò)點(diǎn)對(duì)點(diǎn)的詳細(xì)步驟這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是億速云,小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。