有没有办法在C#.net上使用vb,net class? [英] Is there any way to use vb,net class on C#.net ?

查看:73
本文介绍了有没有办法在C#.net上使用vb,net class?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,怎么样?我希望每个人都很好。

无论如何我有一个问题,那就是:有没有办法在C#.net上使用vb.net类?

或者有没有在C#.net上使用vb.net类或项目的方法?



我需要这个,因为我在vb.net上写了一个项目。在该项目中,我使用类文件上的所有代码。现在我想在C#.net上移动我的项目。所以我需要这个。



我想有人建议我转换代码。我已经尝试了但它没有转换所有代码。

无论如何,如果你知道任何好的vb.net到c#.net lang转换器软件你用的请告诉我,我会尝试。



感谢高级。

解决方案

不仅有办法,它根本不是问题。您可以使用不同的.NET语言创建不同的程序集,在另一个.NET语言中引用一个程序集,并以与使用相同语言编写的同一程序集完全相同的方式使用它。问题根本不存在。







如果你真的需要翻译一种语言到另一种语言(有时你只需要摆脱其中一种语言,显而易见的原因),我可以提出一些在线解决方案和一种非常全面的离线解决方案。请看我过去的答案:

将C#的COde行解释为VB.NET [ ^ ],

需要将vb代码转换为c# [ ^ ],

FixedPage to ContentPage convert c#代码到vb.net [ ^ ]。



-SA

Hi everyone how are all? I hope everyone is fine.
Anyway i have a question and that is : Is there any way to use vb.net class on C#.net ?
Or is there any way to use vb.net classes or project on C#.net ?

I need this because i write a project on vb.net. In that project i use all codes on class files. Now i wanted to move my project on C#.net. So i need this.

I think someone suggest me to convert code. I already try it but it doesn't convert all codes.
Anyway if you know about any good vb.net to c#.net lang converter software which you use pls let me know i will try.

Thanks in advanced.

解决方案

Not only there is a way, it's not a problem at all. You can create different assemblies in different .NET languages, reference one assembly in another and use it in exact same way as it was the same assembly written in the same language. The problem simply does not exist.

[EDIT]

And if you really need to translate from one language to another (sometimes you simply need to get rid of one of the languages, by apparent reason), I can suggest some on-line solutions and one really comprehensive off-line solution. Please see my past answers:
COde Line Interpretatio of C# to VB.NET[^],
Need to convert vb code to c#[^],
FixedPage to ContentPage convert c# code into vb.net[^].

—SA


这篇关于有没有办法在C#.net上使用vb,net class?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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