WinForm
u011909475
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
WinForm 自带串口控件使用
1.串口控件名:SerialPort2.将SerialPort控件拉到[设计]窗口3.在属性栏填写串口名4.在代码区使用 serialPort1.Open();打开串口5.添加 this.serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_D...原创 2018-11-19 18:08:28 · 2375 阅读 · 0 评论 -
c# 16进制字符串转16进制byte[]
public static byte[] strToHexByte(string hexString) { hexString = hexString.Replace(" ", ""); if ((hexString.Length % 2) != 0) hexString += " ";...转载 2018-12-11 18:02:53 · 3695 阅读 · 0 评论 -
C# 使用BitConverter.ToString(byte[] value)转换后字符串带有横杠“-”,去掉横杠方法
使用BitConverter.ToString(byte[] value).Replace("-", ""),可去掉横杠转载 2018-12-11 18:00:43 · 4971 阅读 · 0 评论 -
c# 科学计数转小数
private Decimal ChangeDataToD(string strData) { Decimal dData = 0.0M; if (strData.Contains("E")) { dData = Decimal.Parse(strData.ToS...转载 2018-11-28 09:16:12 · 902 阅读 · 0 评论 -
c# 通过object使用控件
如通过object 使用button控件(利用object as button): public static void fun(object sender) { (sender as Button).BackColor = System.Drawing.Color.Green; }...原创 2018-11-28 08:52:06 · 1185 阅读 · 0 评论 -
c# 延时函数
//延时2000msSystem.Threading.Thread.Sleep(2000);转载 2018-12-04 18:25:59 · 6763 阅读 · 1 评论 -
c# 数据类型转换
在c#中可以使用BitConverter类中的函数进行数据类型转换转载 2018-11-23 14:46:26 · 205 阅读 · 0 评论 -
C# string类型和byte[]类型相互转换
string类型转成byte[]:byte[] byteArray = System.Text.Encoding.Default.GetBytes ( str ); byte[]转成string:string str = System.Text.Encoding.Default.GetString ( byteArray ); string类型转成ASCII byte[]:...转载 2018-11-19 18:24:09 · 361 阅读 · 0 评论 -
问题:线程间操作无效: 从不是创建控件“***”的线程访问它。
在构造函数上添加:System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;转载 2018-11-19 18:12:04 · 189 阅读 · 0 评论 -
c# crc16 x-modem实现
#region Members //size = 256 private static ushort[] crc16tab = new ushort[] {0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7, 0x8108,0...转载 2018-12-11 18:06:13 · 974 阅读 · 0 评论
分享