C#使用小结1
参考资料https://msdn
microsoft
com/zh-cn/library/mt472912(v=vs
aspx 这个链接有所有类库的说明和使用方法举例,非常有用
不同文件中互相调用类public class A{ public void a(){};}public class B{ public void b(){ A aa = new A(); aa
a();}}3
枚举类型与 C 语言不一样的地方为定义好以后,不需要再加 enum 关键字定义新的枚举;使用成员的时候:A
Epublic enum FileType{ FileType_Error = 0, FileType_IntelHex = 1, FileType_SRecord = 2,};private FileType fileType;private FileType GetFileType(){ return fileType;}private void SetFileType(FileType newType){ fileType = newType;}
SetFileType(FileType
FileType_IntelHex);3
截取字符串特定位置的字符fileReadLine
Substring(4, 8); 4 为起始 index,8 为长度3
String 转为数字3
ToString 的格式化方法4
ComboBox-下拉框4
编程方式添加 private void DoBindData() { for (int i = 0; i < 5; i++) { comboBox1
Add(i + 1); } } 4
进行数据源绑定轮询可用串口,并赋值给 comboBox
对话框相关5