From 07041f4f191a3ef973b62dccd3da0a3a5ee4b90d Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Fri, 27 Apr 2018 13:37:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WinFormControl/UWeightControl.cs | 3 ++- WinFormControl/Utils/SoundPalyUtil.cs | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WinFormControl/UWeightControl.cs b/WinFormControl/UWeightControl.cs index 22aff58..ef13629 100644 --- a/WinFormControl/UWeightControl.cs +++ b/WinFormControl/UWeightControl.cs @@ -203,7 +203,8 @@ namespace WinFormControl str = "0"; this.Invoke(new Action(delegate() { - var v = decimal.Parse(str); + decimal v = 0; + decimal.TryParse(str, out v); lblChengZhong.Text = string.Format(format, v); if (str != "0") { diff --git a/WinFormControl/Utils/SoundPalyUtil.cs b/WinFormControl/Utils/SoundPalyUtil.cs index 833f3d5..0348c9c 100644 --- a/WinFormControl/Utils/SoundPalyUtil.cs +++ b/WinFormControl/Utils/SoundPalyUtil.cs @@ -26,8 +26,7 @@ namespace WinFormControl if (!File.Exists(filePath)) return; player.SoundLocation = filePath; - player.Load(); - player.Play(); + player.PlaySync(); } }