首先,声明一个方法,用于在软件启动时调用。

//启动时播放
public void StartPlayer()
{
 System.Media.SoundPlayer sp = new System.Media.SoundPlayer();
//设置播放文件的路径,为应用程序同级目录中的start.wav
 sp.SoundLocation = Application.StartupPath + "/"+"start.wav" ;
//播放
 sp.Play();
}

然后,在窗体加载时调用。

private void Form1_Load(object sender, EventArgs e)
{
  StartPlayer();
}