标签:style blog http color os io ar for div
public static bool User_Login(string url, string uname, string password, out string[] userInfo) { string param = "username=" + uname + "&password=" + password; byte[] bs = Encoding.UTF8.GetBytes(param); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = bs.Length; Stream httpStream = request.GetRequestStream(); httpStream.Write(bs, 0, bs.Length); httpStream.Close(); try { HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8); string result_Msg = sr.ReadToEnd(); response.Close(); sr.Close(); return AnalysisResponseMsg(result_Msg, out userInfo); } catch (Exception ex) { string[] msg = { "RESULT", ex.Message }; userInfo = msg; return false; } }
标签:style blog http color os io ar for div
原文地址:http://www.cnblogs.com/siyunianhua/p/3944053.html