主题:c#下调用API模拟系统注销声音
小弟初来刚到,先献一自己的得意之作:模拟windows系统声音
using System;
using System.Runtime.InteropServices;
namespace a
{
public class b
{
[DllImport("winmm.dll")]
public static extern long PlaySound(String lpszName, long hModule, long dwFlags);
}
public class App
{
public static void Main(String[] args)
{
b.PlaySound("G:\\Windows\\media\\Windows XP 注销音.wav",100,100);
}
}
}
using System;
using System.Runtime.InteropServices;
namespace a
{
public class b
{
[DllImport("winmm.dll")]
public static extern long PlaySound(String lpszName, long hModule, long dwFlags);
}
public class App
{
public static void Main(String[] args)
{
b.PlaySound("G:\\Windows\\media\\Windows XP 注销音.wav",100,100);
}
}
}