public void GetInfo(UpdataUIHandler handler) { HttpWebRequest req = _initRequest(InfoUrl); MyPackage pack = new MyPackage() { PostData = "", Reqest = req, ShowMsgs = handler }; _doPost(pack); }
public void Logout(UpdataUIHandler handler) { HttpWebRequest req = _initRequest(PostUrl); MyPackage pack = new MyPackage() { PostData =Logout_post_str, Reqest = req, ShowMsgs = handler }; _doPost(pack); }
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"); }
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); }