登录
首页 » C# » C#实现网络通信​例子,通信传递消息

C#实现网络通信​例子,通信传递消息

于 2015-06-12 发布
0 262
下载积分: 1 下载次数: 0

代码说明:

C#实现网络通信

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • c# 获取当前系统所有窗口句柄(含任务栏/托盘图标等) 完整源码下载
    c# 获取当前系统所有窗口句柄(含任务栏/托盘图标等) 完整源码下载
    2013-09-14下载
    积分:1
  • hex转bin的程序
    hex转bin的程序, 支持大于64K的hex, 网上下载的Hex2Bin不支持64k. 包含工程文件, 简单包装即可生成一个Hex2Bin的小程序【核心代码】                String szLine = "";                String szHex = "";                if (szHexPath == "")                {                    MessageBox.Show("请选择需要转换的目标文件!         ", "错误");                    return;                }                                StreamReader HexReader = new StreamReader(szHexPath);                                while (true)                {                    szLine = HexReader.ReadLine(); //读取一行数据                    if (szLine == null) //读完所有行                    {                        break;                    }                    if (szLine.Substring(0, 1) == ":") //判断第1字符是否是:                    {                        if (szLine.Substring(1, 8) == "00000001")//数据结束                        {                            break;                        }                        szHex = szLine.Substring(9, szLine.Length - 11); //读取有效字符                    }                }                HexReader.Close(); //关闭目标文件                Int32 i;                Int32 j = 0;                Int32 Length = szHex.Length;                byte[] szBin = new byte[Length];                pbConvert.Maximum = Length / 2;                for (i = 0; i < Length; i = 2) //两字符合并成一个16进制字节                {                    szBin[j] = (byte)Int16.Parse(szHex.Substring(i, 2), NumberStyles.HexNumber);                    j ;                    pbConvert.Increment(i);                                    }                if (szBinPath == "")                {                    szBinPath = Path.ChangeExtension(szHexPath, "bin");                    tbBinPath.Text = szBinPath;                }                FileStream fBin = new FileStream(szBinPath, FileMode.Create); //创建文件BIN文件                BinaryWriter BinWrite = new BinaryWriter(fBin); //二进制方式打开文件                BinWrite.Write(szBin, 0, Length); //写入数据                BinWrite.Flush();//释放缓存                BinWrite.Close();//关闭文件                MessageBox.Show("文件转换完成!        ", "提示");            }            catch (Exception ex)            {                MessageBox.Show(ex.ToString());            }
    2020-12-05下载
    积分:1
  • 大家一起学鸿蒙OS(HarmonyOS)设备开发教程
    【实例简介】
    2021-11-04 00:30:53下载
    积分:1
  • C# 套打Demo
    套打Demo 【核心代码】using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Drawing.Printing;namespace Print_Demo{ public partial class Form1 : Form { public PrintDocument printDt = new PrintDocument(); //打印文档对象 Font printFont; //打印使用的字体 public Form1() { InitializeComponent(); } void printDt_PrintPage(object sender, PrintPageEventArgs e) { float pointX = 10; float pointY = 10; e.Graphics.DrawString("打印内容", new Font("宋体", 16F), Brushes.Black, pointX 60, pointY); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 26,pointX 300,pointY 26); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 35); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 56, pointX 300, pointY 56); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 65); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 86, pointX 300, pointY 86); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 95); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 116, pointX 300, pointY 116); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 125); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 146, pointX 300, pointY 146); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 155); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 176, pointX 300, pointY 176); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 185); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 206, pointX 300, pointY 206); e.Graphics.DrawString("检测结果", printFont, Brushes.Black, pointX, pointY 233); e.Graphics.DrawString("通过", new Font("宋体",22F,FontStyle.Bold), Brushes.Black, pointX 90, pointY 225); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 265, pointX 300, pointY 265); e.Graphics.DrawString("单位名称", printFont, Brushes.Black, pointX, pointY 275); } private void Form1_Load(object sender, EventArgs e) { printDt.PrintPage = new PrintPageEventHandler(printDt_PrintPage); printFont = new Font("宋体", 12F); } private void btnPrint_Click(object sender, EventArgs e) { //PrintDialog printDlg = new PrintDialog(); //printDlg.Document = printDt; //printDlg.AllowPrintToFile = true; //printDlg.AllowCurrentPage = true; //printDlg.AllowSelection = true; //printDlg.ShowDialog(); //printDlg.ShowDialog(); printDt.Print(); } private void btnLook_Click(object sender, EventArgs e) { PrintPreviewDialog printPreview = new PrintPreviewDialog(); printPreview.PrintPreviewControl.Document = printDt; printPreview.ShowDialog(this); } }}
    2021-05-06下载
    积分:1
  • c++ 三个数中取最大值(入门级示例)
    c++ 三个数中取最大值(入门级示例)
    2020-03-03下载
    积分:1
  • 微软c# 字符串通用类
    字符串截取/图片地址提取/ip地址检测。。。。
    2014-03-25下载
    积分:1
  • C语言入门金典书.pdf
    C语言入门金典书C语言程序设计.pdf
    2021-05-06下载
    积分:1
  • c# 人事管理系统完整源码下载(考勤管理、简历管理)
    人事管理系统完整源码(含数据库),其中有 员工简历、考勤录入等功能 友情提示:附加数据库之后,修改 y.cn 中的数据库连接 即可使用(登录账号:10001  密码:123456) public y() { pobjConn.ConnectionString = "server=.;database=rsgl;uid=sa;pwd=sa"; }
    2014-12-18下载
    积分:1
  • C语言入门至精通(全集).pdf【共533页】
    【实例简介】基础课程
    2021-06-10 00:31:03下载
    积分:1
  • C# 二维码 例子源码
    二维码
    2015-05-05下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载