C#中的AddressOf [英] AddressOf in C#
本文介绍了C#中的AddressOf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友们
我在VB中有此代码,
Hi, friends
I''ve this code in VB,
bInited = CLIENT_Init(PtrToLong(AddressOf IniFunc), 0)
我如何将其转换为C#代码
IniFunc是具有参数的函数
thks
How i can convert it to C# code
IniFunc is a function which have arguments
thks
推荐答案
在C#(或.NET中)中,您使用委托将事件分配给方法的地址.
如果您是"C#代表"的"Google",则可以找到有关该主题的大量信息.
这是一个这样的网站:
.NET委托和事件 [
In C# (or .NET in general) you use delegates, to assign an event to the address of a method.
If you "Google" for "C# Delegates" you can find plenty of information on the subject.
Here is one such site:
.NET Delegates and Events[^]
这篇关于C#中的AddressOf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文