且构网

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

如何将C#代码更改为VB.NET请帮帮我

更新时间:2023-02-07 22:58:58

您不能在单个项目中混合使用语言,但无论您使用何种语言编写,都可以引用程序集。

但您可以使用自动翻译程序在它们之间进行转换:代码转换器 [ ^ ]不太糟糕。请注意,它可能无法正确使用,因此在测试时应该真正理解这两种语言,并注意除非该代码的来源针对相同的环境,否则您的代码可能根本不起作用。 br />


一般来说,编写自己的代码比依靠互联网上的代码并进行翻译更好。
You can't mix languages within a single project, although you can reference Assemblies regardless of what language they were written in.
But you can use automated translators to convert between them: Code Converter[^] isn;t too bad. Be aware that it may not get it right, so you should really understand both languages when you test this, and be aware that unless the "source" of that code is targeting the same environment your code is that may not work at all.

Generally speaking, you are better off writing your own code than relying on code you found on the internet and translating it.