惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Vercel News
Vercel News
月光博客
月光博客
S
SegmentFault 最新的问题
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
小众软件
小众软件
WordPress大学
WordPress大学
G
Google Developers Blog
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
博客园 - 【当耐特】
I
InfoQ

博客园 - 左佩玉

通过了 70-316 考试 .NET SDK 工具 线程 进程 程序配置 程序集 全局化和本地化 实现帮助 可访问性设计 实现打印 自定义控件 使用 GDI+ 在ADO.net 中使用xml 绑定、查看和筛选数据 ADO.net 处理和抛出异常 使用Debug和Trace 测试和调试 继承 System.Collections.CollectionBase 创建一个强类型集合类
访问和调用外部组件
左佩玉 · 2005-08-25 · via 博客园 - 左佩玉

访问.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);