|
|
@@ -9,6 +9,7 @@ using UAS_LabelMachine.CustomControl.GroupBoxWithBorder;
|
|
|
using static System.Windows.Forms.Control;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Web.Script.Serialization;
|
|
|
+using System.Media;
|
|
|
|
|
|
namespace UAS_LabelMachine
|
|
|
{
|
|
|
@@ -40,6 +41,26 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static void PlaySound(string FileName)
|
|
|
+ {
|
|
|
+ //要加载COM组件:Microsoft speech object Library
|
|
|
+ if (!System.IO.File.Exists(FileName))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ try
|
|
|
+ {
|
|
|
+ SoundPlayer player = new SoundPlayer();
|
|
|
+ player.SoundLocation = FileName;
|
|
|
+ player.Load();
|
|
|
+ player.Play();
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static string DToAny(double DB, int Type)
|
|
|
{
|
|
|
string H = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|