Browse Source

播放声音文件方法重载

master
yibo 7 years ago
parent
commit
a97c94597c
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      WinFormControl/Utils/SoundPalyUtil.cs

+ 9
- 0
WinFormControl/Utils/SoundPalyUtil.cs View File

@ -20,6 +20,15 @@ namespace WinFormControl
player.Load();
player.Play();
}
public static void PlaySound(string filePath)
{
if (!File.Exists(filePath))
return;
player.SoundLocation = filePath;
player.Load();
player.Play();
}
}
public enum SoundType


Loading…
Cancel
Save