1  /// <summary>
 2     /// App.xaml 的交互逻辑
 3     /// </summary>
 4     public partial class App : Application
 5     {
 6         private void AppExit(object sender, ExitEventArgs e)
 7         {
 8             if (Context.Me != null)
 9             {
10                 Context.Me.State = 3;
11                 Context.PicaClient.UpdateUser(Context.Me);
12             }
13         }
14 
15         private void AppStartup(object sender, StartupEventArgs e)
16         {
17             Process[] List = Process.GetProcesses();
18             if (Process.GetProcessesByName("pica2").Length > 1)
19             {
20                 MessageBox.Show("程序已经登录,不能再次登录。");
21                 Application.Current.Shutdown();
22             }
23         }
24     }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-12
  • 2022-03-09
  • 2022-02-01
  • 2021-06-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-04-28
  • 2021-12-19
  • 2022-01-01
  • 2022-02-05
相关资源
相似解决方案