如何在C#Project中使用VB.Net类文件 [英] How to use VB.Net class file in C# Project
本文介绍了如何在C#Project中使用VB.Net类文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有课程文件,例如用VB.Net编写的Crypto.vb。
我想使用这个Crypto.vb中的定义到我在C#中的Windows窗体(WPF)代码中。
我没有选项,即右键单击时构建,所以无法添加它的引用。
请帮助。
I have class file e.g. Crypto.vb which is written in VB.Net.
I want to use definition from this Crypto.vb into my windows form(WPF) code in C#.
I have no option i.e. build when I right click, so can't add reference of it.
Please help.
推荐答案
1) Add a VB.Net class libary project to your solution.
2) Add the Crypto.vb file to the class library project(Newly created VB.Net Project).
3) Add a reference in your Windows Forms application (C# Project) to your vb.net class library project (VB.Net Project).
4) Use the Crypto class in your Windows Forms application (C# Project).
总结行动 -
目前您正在使用单个C#项目的解决方案。
更改后,您的解决方案中将有两个项目。一个用VB.net,另一个用C#。
这篇关于如何在C#Project中使用VB.Net类文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文