










访问.NET和COM组件
创建引用 Add Reference
使用 using 关键字
实例化ActiveX控件
添加引用
添加到Toolbox
拖放控件或代码方式
访问Web Service
添加web 引用 Add Web Reference
实例化 webService1 myService = new WebService1();
调用 myService.myMethod();
异步调用
例
采用回调方式
public void AsyncDemo()
{
WebService1 myService = new WebService1();
IAsyncResult Async;
//为回调方法创建委托
System.AsyncCallback myCallBack = new System.AsyncCallback(SomeMethod);
Async = myService.BeginMyMethod(myCallBack,new object());
string myString;
//程序暂停,直到调用返回
myString = myService.EndMyMethod(Async);
}
访问Windows API
[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern int Beep(int dwFreq, int dwDuration);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。