使用.cs类的vb.net [英] vb.net using a .cs class

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

问题描述

我获得了一个c#类,可以在我的vb.net项目中使用。我该怎么办

除了将它放在我的vb.net类的项目中以便能够使用它?
使用它?或者我可以不这样做吗?

I was given a c# class to use in my vb.net project. What do i have to do
other than just placing it in my project for my vb.net classes to be able to
use it? Or can I not do that?

推荐答案

打电话给我无知,但不是它只是工作吗?


您是否尝试过使用VB.NET从VB调用c#proc?


它应该可以工作。我已经使用了几个c#dll'并从我的VB

例程调用。也许我错过了一些东西,但我不这么认为。


如果你不能打电话,那么请回信。


Shane


" William Gower" < W _ ***** @ hotmail.com>在消息中写道

新闻:O%*************** @ TK2MSFTNGP10.phx.gbl ...
Call me ignorant but won''t it just work?

Have you tried calling the c# proc from VB using VB.NET?

It should work. I have used several c# dll''s and called from my VB
routines. Maybe I am missing something but I don''t think so.

If you can''t just call it, then please write back.

Shane

"William Gower" <w_*****@hotmail.com> wrote in message
news:O%***************@TK2MSFTNGP10.phx.gbl...
我被给了在我的vb.net项目中使用的ac #class。我需要做什么呢?除了将它放在我的vb.net类的项目中才能使用
来使用它?或者我可以不这样做吗?
I was given a c# class to use in my vb.net project. What do i have to do
other than just placing it in my project for my vb.net classes to be able to use it? Or can I not do that?



2004年6月9日星期三17:17:09 -0400,William Gower写道:
On Wed, 9 Jun 2004 17:17:09 -0400, William Gower wrote:
我在我的vb.net项目中使用了ac #class。除了将它放在我的vb.net类的项目中以便能够使用它之外,我还需要做什么呢?或者我可以不这样做吗?
I was given a c# class to use in my vb.net project. What do i have to do
other than just placing it in my project for my vb.net classes to be able to
use it? Or can I not do that?




你不能在VB.Net项目中使用.cs文件。您必须将.cs文件

放在自己的C#项目中,然后将该项目添加到您的解决方案中。你那么
应该可以和VB一起使用。


-

克里斯


要给我发电子邮件,请删除[",],下划线,午餐和

替换我的电子邮件地址中的某些字词。 br />



You can''t use a .cs file in a VB.Net project. You must place the .cs file
in its own C# project and then add that project to your solution. You
should then be able to use it with VB.

--
Chris

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.


将* .cs文件编译成类库。然后,您可以在VB.NET项目中引用程序集并在代码中使用它


您不能使用Visual Studio在同一项目中混合使用C#和VB.NET。 br />
Compile the *.cs file into a class library. You can then reference the assembly in your VB.NET project and use it in your code

You can''t mix C# and VB.NET in the same project using Visual Studio.


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

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