using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Media; using System.Windows.Forms; namespace BaseFunction { /// <summary> /// 系统声音类文件 /// </summary> public class SystemMusic { //声音播放的类 public static SoundPlayer myplayer = new SoundPlayer(); /// <summary> /// 播放音乐方法 /// </summary> /// <param name="isFor">是否循环播放</param> /// <param name="Path">音乐文件路径</param> public static void PlayMusic(Boolean isFor, string Path) { myplayer.SoundLocation = Path; if (isFor) { myplayer.PlayLooping(); } else { myplayer.Play(); } } /// <summary> /// 系统管理 /// </summary> /// <param name="ifTrue">是否循环播放是为True否则为False</param> public static void System_Management(Boolean isFor) { PlayMusic(isFor, @"sound系统设置.WAV"); } /// <summary> /// 删除 /// </summary> /// <param name="ifTrue">是否循环播放是为True否则为False</param> public static void Delete(Boolean isFor) { PlayMusic(isFor, @"sound删除.WAV"); } } }