- 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
- 2024山东烟台招远市事业单位(卫生综合类)招聘和书历年【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
- 2024山东省委军民融合办所属事业单位招聘拟聘用人员历年【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
- 2024山东德州济技术开发区人民检察院招聘15人历年【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
- 2024山东特检集团招聘24人【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
- 2024山东通达交通投资发展集团限公司招聘17人【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
- 2024山东青岛中化集团营销业务岗春招【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
- 2024山东人才信总科技限公司招聘6人【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
- 2024山东德州市夏津县事业单位综合类岗位招聘合并岗位高分先选历年【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
- 2024山东日照市五莲县事业单位校园招聘拟聘用人员历年【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
- 2024山东潍坊市高密市事业单位招聘7人历年【综合基础知识500题】高频考点模拟试题及参考答案解析.docx
文档评论(0)