套接字的初始化和发送、收取数据
摘要:class ModBusTcp : IDisposable { /// /// 服务端IP地址 例:192.168.1.1 /// public string IP = "192.168.1.1"; /// /// 服务端端口号 例:ModBus默认502 /// public int Port = 502; /// /// 超时时间 /// public int TimeOut = 3; //...
阅读全文
posted @
2013-09-17 11:14
qiulang
阅读(678)
推荐(0)
文件与数组转换
摘要://将文件内容读到数组 public string[][] ReadFileToArray(string strFileName) { //定义数组列表 List listSolarData = new List(); //实例化流操作对象 using (StreamReader readerSolarData = new StreamReader(strFileName)) { string strLine = nu...
阅读全文
posted @
2013-09-17 11:02
qiulang
阅读(782)
推荐(0)
c# 发送邮件
摘要://将文件内容读到数组 public string[][] ReadFileToArray(string strFileName) { //定义数组列表 List listSolarData = new List(); //实例化流操作对象 using (StreamReader readerSolarData = new StreamReader(strFileName)) { string strLine = nu...
阅读全文
posted @
2013-09-17 11:02
qiulang
阅读(174)
推荐(0)
加载动态库
摘要://加载动态库 private void LoadDll() { //获取系统环境路径 string sysPath = System.Windows.Forms.Application.StartupPath; string xmlFile = ""; xmlFile = sysPath + "/StationInfo.xml"; //实例化Xml文档类 XmlDocument xmlDoc = new XmlDocument()...
阅读全文
posted @
2013-09-17 10:53
qiulang
阅读(475)
推荐(0)
写TXT文件
摘要:#region 写日志 private static void writelog(string strwrite) { string strPath = "d:/log.txt"; if (!File.Exists(strPath)) { File.Create(strPath); } //定义写流对象 System.IO.StreamWriter writer = null; //...
阅读全文
posted @
2013-09-17 10:49
qiulang
阅读(336)
推荐(0)
c# 串口操作
摘要:public class CommPort : IDisposable { public string Port = ""; /// ///波特率9600 /// private int BaudRate = 9600; public int BaudRater { set { BaudRate = value; } } /// ///数据位4-8 /// public byte ByteSi...
阅读全文
posted @
2013-09-17 10:04
qiulang
阅读(1408)
推荐(0)
VS2010版快捷键
摘要:VS2010版快捷键Ctrl+E,D ----格式化全部代码Ctrl+E,F ----格式化选中的代码CTRL + SHIFT + B生成解决方案CTRL + F7 生成编译CTRL + O 打开文件CTRL + SHIFT + O打开项目CTRL + SHIFT + C显示类视图窗口F4 显示属性窗口SHIFT + F4显示项目属性窗口CTRL + SHIFT + E显示资源视图F12 转到定义CTRL + F12转到声明CTRL + ALT + J对象浏览CTRL + ALT + F1帮助目录CTRL + F1 动态帮助F1 帮助SHIFT + F1当前窗口帮助CTRL + ALT + F
阅读全文
posted @
2013-09-17 10:01
qiulang
阅读(209)
推荐(0)