public void LoadPara()
{ RegistryKey rk = Registry.LocalMachine; RegistryKey hklm = rk.CreateSubKey(RegRoot + ID.ToString());
commPort.PortName = (string)(hklm.GetValue("PortName","COM1")); commPort.BaudRate = (int)(hklm.GetValue("BaudRate", 9600)); commPort.Parity = (Parity)(hklm.GetValue("Parity",Parity.None)); commPort.StopBits = (StopBits)(hklm.GetValue("StopBits", StopBits.One)); hklm.Close(); }
{ RegistryKey rk = Registry.LocalMachine; RegistryKey hklm = rk.CreateSubKey(RegRoot + ID.ToString());
commPort.PortName = (string)(hklm.GetValue("PortName","COM1")); commPort.BaudRate = (int)(hklm.GetValue("BaudRate", 9600)); commPort.Parity = (Parity)(hklm.GetValue("Parity",Parity.None)); commPort.StopBits = (StopBits)(hklm.GetValue("StopBits", StopBits.One)); hklm.Close(); }
解决方案 »
- winform 如何实现 表示仓库容量的可视化图形???
- 软件开发人员要达到什么水平?
- 没有Web站点,SL怎么加载进浏览器中去的
- 在C#中如何设置只能实例化一个子窗口啊?
- sugengnn(sugengnn)进来取分
- 谁能详细说说SOAP service比COM object有什么好处?越多越好。
- C# 假如有20000条数据需要处理
- SharpZipLib 类 怎么用?
- 请教高手:如何能够获得字符串的编码类型呢?
- 在父类主方法创建父类实例,再在子类类体中创建孙子类的实例,为何会栈溢出
- 在winform中让textbox的初始值为系统的当前时间(年月日)
- 新年快乐,鼠标移动速度太慢,有办法让他再快一些吗?
Enum.Parse(typeof(Parity), hklm.GetValue("Parity",Parity.None));---------------------------------------------------------------
http://pointlessly.blogspot.com