using System;
using System.Runtime.InteropServices;
namespace deep
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
public class Class1
{
[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);
}
} }
}没问题------ 已启动生成: 项目: deep, 配置: Debug .NET ------正在准备资源...
正在更新引用...
正在执行主编译...项目是最新的。
正在生成附属程序集...---------------------- 完成 --------------------- 生成: 1 已成功, 0 已失败, 0 已跳过
是不是中文字符
using System.Runtime.InteropServices;
namespace deep
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
public class Class1
{
[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);
}
} }
}没问题------ 已启动生成: 项目: deep, 配置: Debug .NET ------正在准备资源...
正在更新引用...
正在执行主编译...项目是最新的。
正在生成附属程序集...---------------------- 完成 --------------------- 生成: 1 已成功, 0 已失败, 0 已跳过
是不是中文字符
using System;
using System.Runtime.InteropServices; namespace Beep
{
class Class1
{
[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);
}
}
}
}