using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Media;
namespace 背景音乐1{ class Sound { //声音对象 static System.Media.SoundPlayer sp = new System.Media.SoundPlayer();
//合格 static string strQualified = @"1.wav";
//不合格 static string strDisqualified = @"1.wav";
//报警 static string strAlarm = @"1.wav";
public static void Qualified() { sp.SoundLocation = strQualified; sp.Play(); }
public static void Disqualified() { sp.SoundLocation = strDisqualified; sp.Play(); }
public static void Alarm() { sp.SoundLocation = strAlarm; sp.Play(); } }}
namespace 背景音乐1{ class Sound { //声音对象 static System.Media.SoundPlayer sp = new System.Media.SoundPlayer();
//合格 static string strQualified = @"1.wav";
//不合格 static string strDisqualified = @"1.wav";
//报警 static string strAlarm = @"1.wav";
public static void Qualified() { sp.SoundLocation = strQualified; sp.Play(); }
public static void Disqualified() { sp.SoundLocation = strDisqualified; sp.Play(); }
public static void Alarm() { sp.SoundLocation = strAlarm; sp.Play(); } }}