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 }