Пример #1
0
        public USB_Join(Service s, string serial)
        {
            InitializeComponent();

            service = s;
            Serial = serial;
            userinfo = service.FindUserInfo(serial);
        }
Пример #2
0
        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();
            }
        }