找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 5101|回复: 1

[开源] 【C#】C#调用API 及使用例子

[复制链接]

1214

主题

352

回帖

11

精华

管理员

菜鸟

积分
93755

贡献奖关注奖人气王精英奖乐于助人勋章

发表于 2016-10-19 06:32:47 | 显示全部楼层 |阅读模式
  1. using System.Text;
  2. using System.Runtime.InteropServices;
  3. public class api
  4. {
  5.     [DllImport("user32.dll", EntryPoint = "MessageBox")]
  6.     public static extern int MsgBox(int hWnd, String text, String caption, uint type);

  7.     [DllImport("kernel32.dll")]
  8.     public static extern int GetShortPathName(string path, StringBuilder shortPath, int shortPathLength);
  9. }

  10. 调用:api.MsgBox(0, "a", "b", 64);
复制代码
【VB】QQ群:1422505加的请打上VB好友
【易语言】QQ群:9531809  或 177048
【FOXPRO】QQ群:6580324  或 33659603
【C/C++/VC】QQ群:3777552
【NiceBasic】QQ群:3703755

857

主题

2632

回帖

2

精华

管理员

此生无悔入华夏,  长居日耳曼尼亚。  

积分
36130
发表于 2016-11-12 09:11:24 | 显示全部楼层
有点像VB.NET
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

快速回复 返回顶部 返回列表