前端之家收集整理的这篇文章主要介绍了
[VB.NET]求救,将C#的一句代码翻译是vb.net的代码!,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
求救,将C#的一句
代码翻译是vb.net的
代码! strWidth = (w > = 600) ? " width=/ "600/ " " : " "; 这句
代码使用vb.net该如何写,请高手指点。 __________________________________________________________________________ strWidth = IIf(w > = 600," width= " "600 " " "," ") __________________________________________________________________________ strWidth = (w > = 600) ? " width=/ "600/ " " : " " http://www.kamalpatel.net/ConvertCSharp2VB.aspx __________________________________________________________________________ 楼上不懂就不要在这捣乱了~ __________________________________________________________________________ viena(维也纳N02) 正解 __________________________________________________________________________ 不好意思,是从http://www.kamalpatel.net/ConvertCSharp2VB.aspx网上转过来的. __________________________________________________________________________ strWidth = (w > = 600) ? " width=/ "600/ " " : " "; 等价于 if (w > = 600) then strWidth = " width=/ "600/ " " else strWidth = " " end if __________________________________________________________________________ 不太会VB __________________________________________________________________________ 我翻译的好像还不对,strWidth = " width=/ "600/ " " 这句有问题,斜杠在C++中表示转义符,不知道翻译到VB中该如何。 __________________________________________________________________________ C++中的 / " 在vb中表示一个 ",应该按如下翻译: strWidth = (w > = 600) ? " width=/ "600/ " " : " "; 等价于 if (w > = 600) then strWidth = " width= " "600 " " " else strWidth = " " end if __________________________________________________________________________ 用IIF IIF( (w > = 600)," width=/ "600/ " "," ") __________________________________________________________________________ wzuomin() 是对滴^_^ __________________________________________________________________________ strWidth = IIf(w > = 600," width= ''600 '' "," ") __________________________________________________________________________ IIF( (w > = 600)," ")这个也是对滴! __________________________________________________________________________
原文链接:https://www.f2er.com/vb/263790.html