示例#1
0
文件: API.cs 项目: nuieee/win-rt-feup
 public static void performLogin(String user, String password, handleJSON ascResult)
 {
     getReply(API.getAuthenticationUrl(user, password), ascResult);
 }
示例#2
0
文件: API.cs 项目: nuieee/win-rt-feup
        public static void getReply(String url, handleJSON ascResult)
        {
            try {
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

                request.ContentType = "application/x-www-form-urlencoded";
                request.Method = "POST";
                request.CookieContainer = API.cContainer;

                // start the asynchronous operation
                request.BeginGetRequestStream(new AsyncCallback(GetRequestStreamCallback),
                                              new HttpWebRequestCallBack(request, ascResult));
            }
            catch
            {
                ascResult(null);
                return;
            }
        }