Esempio n. 1
0
 public void GetInfo(UpdataUIHandler handler)
 {
     HttpWebRequest req = _initRequest(InfoUrl);
     MyPackage pack = new MyPackage()
     {
         PostData = "",
         Reqest = req,
         ShowMsgs = handler
     };
     _doPost(pack);
 }
Esempio n. 2
0
 public void Logout(UpdataUIHandler handler)
 {
     HttpWebRequest req = _initRequest(PostUrl);
     MyPackage pack = new MyPackage()
     {
         PostData =Logout_post_str,
         Reqest = req,
         ShowMsgs = handler
     };
     _doPost(pack);
 }
Esempio n. 3
0
 private void _doPost(MyPackage mp)
 {
     //HttpUtility.UrlEncode()
     mp.Reqest.BeginGetRequestStream(new AsyncCallback(GetRequestStreamCallback), mp);
     //ThreadPool.RegisterWaitForSingleObject(result.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), request, _timeout, true);
     alldone.WaitOne();
     alldone.Reset();
     mp.Reqest.BeginGetResponse(new AsyncCallback(GetResponsetStreamCallback), mp);
     Debug.WriteLine("1212321312312");
     alldone.WaitOne();
     alldone.Reset();
     Debug.WriteLine("done");
 }
Esempio n. 4
0
 public void Login(UpdataUIHandler handler)
 {
     HttpWebRequest req = _initRequest(PostUrl);
     MyPackage pack = new MyPackage()
     {
         PostData = String.Format(Login_post_template, _uName, _uPwd),
         Reqest = req,
         ShowMsgs = handler
     };
     _doPost(pack);
 }