从vb.net转换c# [英] Convert from vb.net c#

查看:77
本文介绍了从vb.net转换c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



有谁能告诉我如何将这个Dim thisString转换为String =从vb.net转换为c#please?

Hello All,

Can anybody tell me how I can convert this Dim thisString As String = """" from vb.net to c# please?

推荐答案

看看这里:

Have a look here:



string thisString = @"""""";




Dim thisString As String = """"





详情请见:

字符串数据Ty pe(Visual Basic) [ ^ ]

字符串(C#编程指南) [ ^ ]





谢谢你,戴夫的评论。



包括双引号在@ -quoted字符串中标记,加倍

来源:字符串(C#参考) [ ^ ]



[/ EDIT]



For further information, please, see:
String Data Type (Visual Basic)[^]
Strings (C# Programming Guide)[^]


Thank you, Dave for your comment.

To include a double quotation mark in an @-quoted string, double it
Source: string (C# Reference)[^]

[/EDIT]


从中选择任何转换器

.NET代码转换 - 转换代码 [ ^ ]
Pick any converter from this
.NET Code Conversion - Convert your code[^]


您已经获得了一些关于自动翻译的建议,但不幸的是,最缺乏最全面的离线方法。



一个非常棒的离线解决方案是开源的ILSpy:

http://www.ilspy.net/ [ ^ ],

http://en.wikipedia .org / wiki / .NET_Reflector [ ^ ] 。



首先,您需要编译项目并获得已编译的程序集。它编译为CIL:

http://en.wikipedia.org/wiki/Common_Intermediate_Language [ ^ ]。



您可以将程序集加载到ILSpy中并对其进行反汇编。它有输出语言选项。选择C#或VB.NET,然后重新编译所需的部分代码。你已经完成。



你也可以使用上面引用的Reflector,但它不是完全免费的而不是开源的,它被ILSpy取代。



对于在线翻译:根据我的观察,这个比其他人更准确: http://converter.telerik.com/ [ ^ ]。



祝你好运,

-SA
You already got some advice on automatic translation, but unfortunately, the most comprehensive off-line method is missing.

A really wonderful off-line solution is the open-source ILSpy:
http://www.ilspy.net/[^],
http://en.wikipedia.org/wiki/.NET_Reflector[^].

First, you need to compile the project and obtain a compiled assembly. It is compiled to CIL:
http://en.wikipedia.org/wiki/Common_Intermediate_Language[^].

You can load assembly into ILSpy and disassemble it. It has the option for output language. Select either C# or VB.NET, and recompile the part of code you need. You are done.

You can also use Reflector referenced above, but it is not completely free and not open-source, it is being superseded by ILSpy.

As to on-line translators: in my observations, this one is more accurate than some others: http://converter.telerik.com/[^].

Good luck,
—SA


这篇关于从vb.net转换c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆