- 1、本文档共8页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
c实现的一个类似QQ的局域网通讯程序
本文介绍了用c#实现的一个类似QQ的局域网通讯程序,当点击最小化程序跑到系统托盘里,双击托盘可以可以显示主页面。程序运行界面如下:托盘里的菜单如下:c#作为微软.Net战略的重要棋子,对网络编程提供了很好的支持和优化。实现起来特别方便,还是看代码吧,已经注释的很清楚了。工程文件放在后面了,需要的可以下载代码如下:using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.IO;using System.Net.Sockets;using System.Threading;namespace p2pChat{? ? /// summary? ? /// MainForm 的摘要说明。? ? /// /summary? ? public class MainForm : System.Windows.Forms.Form? ? {? ? ? ? private System.Windows.Forms.Label label1;? ? ? ? private System.Windows.Forms.Label label2;? ? ? ? private System.Windows.Forms.TextBox txtIp;? ? ? ? private System.Windows.Forms.TextBox txtRecord;? ? ? ? private System.Windows.Forms.TextBox txtName;? ? ? ? private System.Windows.Forms.Button btnSend;? ? ? ? private System.Windows.Forms.TextBox txtContent;? ? ? ? private TcpListener tcpLister = new TcpListener(5566); ? ? ? ? ? ? System.Threading.ThreadStart listenPort;? ? ? ? System.Threading.Thread lister;? ? ? ? private System.Windows.Forms.Label label3; ? ? ? ? ? ? System.Windows.Forms.NotifyIcon NotifyIcon1;? ? ? ? //托盘里显示的图标,我用的是QQ里的宠物狗的图标? ? ? ? private Icon img = new Icon(@C:\OpenPet.ico);? ? ? ? System.Windows.Forms.ContextMenu nMenu;? ? ? ? /// summary? ? ? ? /// 必需的设计器变量。? ? ? ? /// /summary? ? ? ? private System.ComponentModel.Container components = null;? ? ? ? public MainForm()? ? ? ? {? ? ? ? ? ? ? //? ? ? ? ? ? ? // Windows 窗体设计器支持所必需的? ? ? ? ? ? ? //? ? ? ? ? ? ? InitializeComponent();? ? ? ? ? ? ? //不显示最大化按钮? ? ? ? ? ? ? this.MaximizeBox = false; ? ? ? ? ? ? ? ? ? //最小化时不显示在任务栏? ? ? ? ? ? ? this.ShowInTaskbar = false;? ? ? ? ? ? ? listenPort += new ThreadStart(this.Listen);? ? ? ? ? ? ? lister = new Thread(listenPort);? ? ? ? ? ? ? this.Closing += new System.ComponentModel.CancelEventHandler(abortLister);? ? ? ? ? ? ? Initializenotifyicon();? ? ? ? ? ? ? //? ? ? ? ? ? ? // TODO: 在 InitializeComponent 调用后添
您可能关注的文档
- Bat学习笔记大全.doc
- bat编程教程.doc
- BEC的考试参考书目.doc
- BBD4360双进双出磨煤机运行出现的问题及对策.doc
- Berg平衡量表评定标准.doc
- BF无氰碱铜工艺研究.doc
- BFT考试复习心得.doc
- ARK300系统培训资料.doc
- BIM软件对比资料.doc
- BMC注塑教程一.doc
- 甘肃省白银市会宁县第一中学2025届高三3月份第一次模拟考试化学试卷含解析.doc
- 2025届吉林市第一中学高考考前模拟生物试题含解析.doc
- 四川省三台县芦溪中学2025届高三下第一次测试生物试题含解析.doc
- 2025届江苏省启东市吕四中学高三适应性调研考试历史试题含解析.doc
- 浙江省宁波市十校2025届高三二诊模拟考试历史试卷含解析.doc
- 甘肃省甘南2025届高考生物必刷试卷含解析.doc
- 河北省石家庄市一中、唐山一中等“五个一”名校2025届高考历史四模试卷含解析.doc
- 江西省南昌市进贤一中2025届高考生物考前最后一卷预测卷含解析.doc
- 甘肃省白银市会宁县第四中学2025届高三第二次模拟考试历史试卷含解析.doc
- 宁夏银川市宁夏大学附属中学2025届高考化学押题试卷含解析.doc
文档评论(0)