如何从c#调用vb方法 [英] how to call vb methods from c#

查看:307
本文介绍了如何从c#调用vb方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我想通过c#使用vb控制台应用程序方法

如何在c#pls帮助中调用该方法我







提前感谢'

Athi Varathan

解决方案

这个问题毫无意义。您可能没有清楚地看到应用程序和库之间的区别。



但是,非常正式,任何程序集都可以用作库:您可以参考另一个程序集的任何有效程序集,无论它是编译为应用程序还是类库。在.NET中,差异是微不足道的(应用程序有一个入口点,就是它,这不是问题)。问题是代码的设计:你不能指望应用程序的程序集适合用作库。它可能不是为此目的而设计的。当然,您始终可以使用 System.Diagnostics.Process.Start 运行任何应用程序,但它不会为您提供许多新功能...... :-)



对于C#与VB.NET,当涉及从一个代码到另一个代码的调用时,差异不存在。这与从C#到C#或VB.NET到VB.NET代码的调用完全相同。



-SA

Hi Friends,
I Want to use vb console application methods through c# .
How i call call that method in c# pls help me



Thank''s in advance
Athi Varathan

解决方案

The question makes no sense. You probably don''t clearly see the difference between an application and a library.

However, quite formally, any assembly can be used as a library: you can reference any valid assembly by another assembly, no matter if it compiled as application or a class library. In .NET, the difference is insignificant (an application has an entry point, that''s it, which is not a problem). The problem is the design of the code: you cannot expect that the application''s assembly is suitable for using as a library. It may not be designed for this purpose. Of course, you can always run any application using System.Diagnostics.Process.Start, but it does not give you many new features… :-)

As to C# vs. VB.NET, when a call from one code to another is concerned, the difference does not exist. This is done in exact same ways as the call from C# to C# or VB.NET to VB.NET code.

—SA


这篇关于如何从c#调用vb方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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