您的位置:首页 > 编程语言 > C#

C#中调用Windows API

2009-03-09 21:46 267 查看
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace BeepTest
{
class Program
{
[DllImport("kernel32.dll")]
public static extern bool Beep(int frequency, int duration);
static void Main(string[] args)
{
Random random = new Random();
for (int i=0; i < 10000; i++)
{
Beep(random.Next(10000), 100);
}
}
}
}

还是不会用,c#调用WindowsAPI,怎样才算会,怎样才算懂
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: