class callAPICls { [DllImport("user32.dll")] public static extern int MessageBoxA(int h, string m, string c, int type); } private void button2_Click(object sender, System.EventArgs e) { callAPICls _callAPICls = new callAPICls();
PlayWAV.PlaySound("c:\\chimes.wav",0,0);
} //调用 user32.dll吧。
sorry,写错了 class PlayWAV { [DllImport("winmm.dll")] public static extern long PlaySound(String lpszName, long hModule, long dwFlags); }private void button2_Click(object sender, System.EventArgs e) {
说的详细点
{
[DllImport("user32.dll")]
public static extern int MessageBoxA(int h, string m, string c, int type);
} private void button2_Click(object sender, System.EventArgs e)
{
callAPICls _callAPICls = new callAPICls();
PlayWAV.PlaySound("c:\\chimes.wav",0,0);
}
//调用 user32.dll吧。
class PlayWAV
{
[DllImport("winmm.dll")]
public static extern long PlaySound(String lpszName, long hModule, long dwFlags); }private void button2_Click(object sender, System.EventArgs e)
{
PlayWAV.PlaySound("c:\\chimes.wav",0,0);
}