using DeviceCenter.model; using Newtonsoft.Json; using System; using System.Windows; namespace DeviceCenter { /// /// App.xaml 的交互逻辑 /// public partial class App : Application { System.Threading.Mutex mutex; public App() { this.Startup += new StartupEventHandler(App_Startup); } void App_Startup(object sender, StartupEventArgs e) { bool ret; mutex = new System.Threading.Mutex(true, "ElectronicNeedleTherapySystem", out ret); if (!ret) { Environment.Exit(0); } Config config = new Config(); string json = JsonConvert.SerializeObject(config, Formatting.Indented); Console.WriteLine(json); } } }