且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何将此c#代码转换为vb.net?

更新时间:2022-11-07 23:37:43

除了用于翻译的在线工具(解决方案1中引用的工具)似乎是***的之一),有一个非常好的和全面的离线开源解决方案。



这是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,然后重新编译所需的部分代码。你已经完成了。



您可以将整个程序集一次性反编译成一个完整的项目,包含所有源代码并随时可以使用Visual Studio。



祝你好运,

-SA
In addition to on-line tools for translation (the one referenced in Solution 1 seems to be one of the best), there is a really good and comprehensive off-line open-source solution.

This is 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 decompile the whole assembly at once into a whole full project, complete with all source code and ready to use with Visual Studio.

Good luck,
—SA


你真的试过看吗为了它?如果您进行谷歌搜索,第一个结果将是:



http://www.developerfusion.com/tools/convert/csharp-to-vb/ [ ^ ]



这给了我这个结果:



Did you really try to look for it? If you do a Google search, the first result would be this:

http://www.developerfusion.com/tools/convert/csharp-to-vb/[^]

And that gives me this result:

For Each clm As DataGridViewColumn In grdView.Columns
	Dim FoundData As Bool = False
	For Each row As DataGridViewRow In grdView.Rows
		If row.Cells(clm.Index).Value.ToString() <> String.Empty Then
			FoundData = True
			Exit For
		End If
	Next
	If Not FoundData Then
		grdView.Columns(clm.Index).Visible = False
	End If
Next