欢迎来到天天文库
浏览记录
ID:41136727
大小:26.73 KB
页数:26页
时间:2019-08-17
《c# tcp调试助手源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、c#tcp调试助手源代码以下是winformtcp调试助手源代码,调试通过,可进行简单应用usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;//添?加ó新?的?名?称?空?间?引皔用?usingSystem.IO;usingSystem.Net;using
2、System.Net.Sockets;usingSystem.Threading;//usingSystem.Timers;namespaceTCP调獭?试?助ú手?{publicpartialclassForm1:Form{/*****服务?端?*******/privateintserve_portNum=13;privateTcpListenerserve_listener=null;//服务?器÷与?客í户§机ú之?间?的?连?接ó状痢?态?privateboolbserve_Connected=false;//服务?器÷侦
3、ì听瑈线?程ìprivateThreadtserve_AcceptMsg=null;//网?络?访?问ê的?基ù础?数簓据Y流ⅰ?privateNetworkStreamnStream_serve=null;//创洹?建¨读á取?器÷privateTextReadertReader_serve=null;//创洹?建¨编括?写′器÷privateTextWriterwReader_serve=null;/*****客í户§端?*******/privateintClient_portNum=13;//客í户§端?连?接óprivateTc
4、pClientclient_client=null;//客í户§机ú与?服务?器÷之?间?的?连?接ó状痢?态?privateboolbclient_Connected=false;//客í户§机ú侦ì听瑈线?程ìprivateThreadtclient_AcceptMsg=null;//网?络?访?问ê的?基ù础?数簓据Y流ⅰ?privateNetworkStreamnStream_client=null;//创洹?建¨读á取?器÷privateTextReadertReader_client=null;//创洹?建¨编括?写′器÷p
5、rivateTextWriterwReader_client=null;//接ó收?、¢发ぁ?送í数簓据Y池?长¤度èprivateconstintbytelength=1024;//服务?器÷接ó收?池?byte[]serve_rec_buff=newbyte[bytelength];//服务?器÷发ぁ?送í池?byte[]serve_send_buff=newbyte[bytelength];//客í户§端?接ó收?池?byte[]client_rec_buff=newbyte[bytelength];//客í户§端?发ぁ?送í池
6、?byte[]client_send_buff=newbyte[bytelength];publicForm1(){InitializeComponent();rb_xs_zf.Checked=true;rb_fs_zf.Checked=true;rb_fwq.Checked=true;cb_fs_cf.Checked=false;btn_Qidong.Enabled=false;//timer1=newSystem.Windows.Forms.Timer();timer1.Stop();timer2.Stop();}privatevoi
7、dtextBox1_TextChanged(objectsender,EventArgse){}privatevoidlabel2_Click(objectsender,EventArgse){}privatevoidtextBox1_TextChanged_1(objectsender,EventArgse){}//服务?器÷启?动ˉprivatevoidQidong_btn_Click(objectsender,EventArgse){serve_portNum=int.Parse(tbx_lport.Text);stringstr
8、localip=cBox_localip.Text;IPAddresslocaladdr=null;localaddr=IPAddress.Parse(strlocalip);//listen
此文档下载收益归作者所有