private void Button_Click_1(object sender, RoutedEventArgs e) { switch (((Button)sender).Content.ToString()) { case "USB 등록": { this.Hide(); member = new USB_Member(service, Serial); if (member.ShowDialog() == true) { Application.Current.Properties["Members"] = service.Join(Serial); Application.Current.Properties["User"] = Serial; string userinfo = service.FindUserInfo(Serial); WindowsStyle window = new WindowsStyle(service, userinfo); window.Show(); service.First_Files(); service.First_FileRoomFiles(); } else this.Show(); } break; case "USB 재등록": { this.Hide(); rejoin = new USB_Rejoin(service, Serial); if (rejoin.ShowDialog() == true) { Application.Current.Properties["Members"] = service.Join(Serial); Application.Current.Properties["User"] = Serial; userinfo = service.FindUserInfo(Serial); WindowsStyle window = new WindowsStyle(service, userinfo); window.Show(); service.First_Files(); service.First_FileRoomFiles(); } else this.Show(); } break; } }
private void Application_Startup(object sender, StartupEventArgs e) { Service service = new Service(); GetUsbPath getusbpath = new GetUsbPath(); Application.Current.Properties["USBDrivePath"] = getusbpath.GetUsbDriverName(); ////if (e.Args.Length > 0) ////{ //// string serial = e.Args[0]; //string serial = "AA010103131909207553"; //if (service.Find(serial)) //{ // Application.Current.Properties["Members"] = service.Join(serial); // Application.Current.Properties["User"] = serial; // string userinfo = service.FindUserInfo(serial); // WindowsStyle window = new WindowsStyle(service, userinfo); // window.Show(); //} //else //{ // USB_Join usb_window = new USB_Join(service, serial); // usb_window.Icon = new BitmapImage(new Uri(@"../../아이콘/HP-Flash-Drive.ico", UriKind.Relative)); // usb_window.Show(); //} //} ////else ////{ //// USB_Login usb_login = new USB_Login(service); //// usb_login.Icon = new BitmapImage(new Uri(@"../../아이콘/HP-Flash-Drive.ico", UriKind.Relative)); //// usb_login.Show(); ////} if (e.Args.Length > 0) { string serial = e.Args[0]; //string serial = "AA010103131909207553"; if (service.Find(serial)) { Application.Current.Properties["Members"] = service.Join(serial); Application.Current.Properties["User"] = serial; string userinfo = service.FindUserInfo(serial); WindowsStyle window = new WindowsStyle(service, userinfo); window.Show(); } else { USB_Join usb_window = new USB_Join(service, serial); //usb_window.Icon = new BitmapImage(new Uri(@"../../아이콘/HP-Flash-Drive.ico", UriKind.Relative)); usb_window.Show(); } } else { USB_Login usb_login = new USB_Login(service); usb_login.Show(); } }