Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();

            _client = HttpClient.BeginSession("12306");
            //if (_client.Restore())
            //{
            //    new _12306Proxy(_client).T();
            //}

            _ctlListForm.ItemsSource = Cities.Data;
            _ctlListTo.ItemsSource = Cities.Data;

            _ctlListPassenger.ItemsSource = Passengers.Data;
            _ctlListTrainType.ItemsSource = Trains.Types;

            LoginWindow window = new LoginWindow(_client);
            if (window.ShowDialog() == true)
            {
                _randCode = window.LoginModel.RandCode;
                _client.Store();

                button1.IsEnabled = false;
            }
            else
            {
                button1.IsEnabled = true;
            }
        }
Esempio n. 2
0
        public LoginWindow(HttpClient client)
        {
            InitializeComponent();

            _client = client;


            OnGet();
        }
Esempio n. 3
0
        public MainForm()
        {
            InitializeComponent();
            
            client = HttpClient.BeginSession("wdm");


            _thread = new Thread(Run);
            _thread.Start();
        }
Esempio n. 4
0
        public static HttpClient BeginSession(string sessionID)
        {
            if (s_sessions.ContainsKey(sessionID))
            {
                return s_sessions[sessionID];
            }

            HttpClient httpClient = new HttpClient();
            httpClient._sessionID = sessionID;
            s_sessions.Add(sessionID, httpClient);
            return httpClient;
        }
Esempio n. 5
0
        public AutoOrderWindow()
        {
            InitializeComponent();

            _client = HttpClient.BeginSession("12306");
            //if (_client.Restore())
            //{
            //    new _12306Proxy(_client).T();
            //}

            this.Loaded += new RoutedEventHandler(AutoOrderWindow_Loaded);
        }
        public InputRandCodeWindow(HttpClient client)
        {
            InitializeComponent();



            _12306Proxy proxy = new _12306Proxy(client);
            byte[] data = proxy.GetVerifyImage2();
            BitmapImage bi = new BitmapImage();
            bi.BeginInit();
            bi.StreamSource = new MemoryStream(data);
            bi.EndInit();
            this.image1.Source = bi;

        }
Esempio n. 7
0
        public MainWindow_test()
        {
            InitializeComponent();

            _client = HttpClient.BeginSession("12306");
            //if (_client.Restore())
            //{
            //    new _12306Proxy(_client).T();
            //}

            _ctlListForm.ItemsSource = Cities.Data;
            _ctlListTo.ItemsSource = Cities.Data;


            _ctlOrderTrain.ItemsSource = Trains.Data;


            _ctlListPassenger.ItemsSource = Passengers.Data;
        }
Esempio n. 8
0
 public _12306Proxy(HttpClient client)
 {
     _client = client;
 }
Esempio n. 9
0
        public MainWindow()
        {
            InitializeComponent();

            _client = HttpClient.BeginSession("17xy");
        }
Esempio n. 10
0
 public HLProxy(HttpClient client)
 {
     _client = client;
 }
Esempio n. 11
0
 public BaiduImageProxy(HttpClient client)
 {
     _client = client;
 }
Esempio n. 12
0
        public MainWindow()
        {
            InitializeComponent();

            _client = HttpClient.BeginSession("baiduimage");
        }