首页 新闻 会员 周边

vb.net 转c#

0
悬赏园豆:15 [已关闭问题] 关闭于 2010-12-23 14:45

转换下列句子:

My.Computer.Ports.SerialPortNames.Count

My.Computer.Ports.SerialPortNames(i)

cbocomports.Items(0).ToString

vb.net中  with       end with  在c#中怎么用

问题补充: cbocomports.Items(0).ToString vb.net中 with end with 在c#中怎么用 这两个有人回答不?
wzl2的主页 wzl2 | 初学一级 | 园豆:165
提问于:2010-12-17 10:07
< >
分享
所有回答(4)
0

C#中没有.

Launcher | 园豆:45045 (高人七级) | 2010-12-17 10:45
那我要相同的效果,应该怎么写
支持(0) 反对(0) wzl2 | 园豆:165 (初学一级) | 2010-12-17 10:49
@wzl2:添加 Microsoft.VisualBasic 程序集引用; using Microsoft.VisualBasic.Devices; Computer c =new Computer(); int count = c.SerialPortNames.Count; string name = c.SerialPortNames[0];
支持(0) 反对(0) Launcher | 园豆:45045 (高人七级) | 2010-12-17 13:24
还是有错~~~用软件翻译的就是这样的语句~~~但还是有错,就不知道为什么了,reference也有加,using也加了,还是不可以 Error 2 'Microsoft.VisualBasic.Devices.Computer' does not contain a definition for 'SerialPortNames' and no extension method 'SerialPortNames' accepting a first argument of type 'Microsoft.VisualBasic.Devices.Computer' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\sadmin\Desktop\bbb\bbb\Form1.cs 53 27 bbb
支持(0) 反对(0) wzl2 | 园豆:165 (初学一级) | 2010-12-20 15:31
0

using ........

lzhdim | 园豆:642 (小虾三级) | 2010-12-17 10:54
.......
支持(0) 反对(0) wzl2 | 园豆:165 (初学一级) | 2010-12-17 10:57
0
邀月 | 园豆:25475 (高人七级) | 2010-12-17 10:57
感谢先,但还是有问题My.Computer.Ports.SerialPortNames.Count My.Computer.Ports.SerialPortNames() 没有属性
支持(0) 反对(0) wzl2 | 园豆:165 (初学一级) | 2010-12-17 11:34
0

baidu一下这个软件,vbtocs_setup,基本的转换都可以,找不到我可以发给你

彭汉生 | 园豆:1233 (小虾三级) | 2010-12-17 12:09
感谢
支持(0) 反对(0) wzl2 | 园豆:165 (初学一级) | 2010-12-20 09:16
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册