dot net framework中的语言互操作性演示 [英] Language Interoperability Demo in dot net framework

查看:83
本文介绍了dot net framework中的语言互操作性演示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从vb中的应用程序表单中获取数据到c#.net中的应用程序表格

在windows应用程序中

解决方案

那里没有这样的问题。 .NET语言之间没有障碍。换句话说,您使用不同.NET语言编写的程序集与使用相同语言的程序一样。您可以使用类 System.Reflection.Assembly 在运行时期间通过另一个程序集引用一个程序集或加载它。如果使用的是Visual Studio并且引用了程序集,则可以单击引用节点以浏览引用的程序集。它将显示你可以在其中公开使用的内容。 (为什么我说公开?因为反射允许甚至使用非公开类型和成员。)Intellisense也会告诉你写什么。



如果另一个项目是纯粹的非托管,你不能这样做,但你可以使用P / Invoke,这要困难得多:

http://en.wikipedia.org/wiki/P/Invoke [ ^ ],

http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp [ ^ ]。



-SA

how to fetch a data from A application form in vb to application form in c# .net
in windows application

解决方案

There is no such a problem. There are no barriers between .NET language. In other words, you work with an assembly written in different .NET language the same way as in the same language. You reference one assembly by another assembly or load it during runtime using the class System.Reflection.Assembly. If you are using Visual Studio and the assembly is referenced, you can click on the reference node to browse the referenced assembly. It will show what can you openly use in it. (Why I say "openly"? because reflection allows to use even non-public types and members.) And Intellisense will show you what to write, too.

If another project is pure unmanaged, you cannot do it, but you can use P/Invoke, which is much more difficult:
http://en.wikipedia.org/wiki/P/Invoke[^],
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp[^].

—SA


这篇关于dot net framework中的语言互操作性演示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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