using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace HRT_Measure { internal static class Program { /// /// 应用程序的主入口点。 /// [STAThread] static void Main() { // 中文授权示例 if (!HslCommunication.Authorization.SetAuthorizationCode("8cb26b16-6848-46b8-a9e4-6f57336b2872")) { MessageBox.Show("授权失败!当前程序只能使用24小时!"); return; // 激活失败就退出系统 } bool isRuned; System.Threading.Mutex mutex = new System.Threading.Mutex(true, "OnlyRunOneInstance", out isRuned); if (isRuned) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FrmMain()); mutex.ReleaseMutex(); } else { MessageBox.Show("程序已启动!\r\nThe program has started", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }