i used this coding in asp.net web application. may be the requestinng arguement(userid and password) is not correct format. i think this blow coding for consol application. how to send those arguement in asp.net web application ? or what is the problem?
public void functionname() { HttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create("http://xxxxx/function.asmx/login"); myRequest.Method = "POST"; using (StreamWriter requestWriter = new StreamWriter(myRequest.GetRequestStream())) { requestWriter.Write("&{0}={1}", HttpUtility.UrlEncode("UserId"), HttpUtility.UrlEncode("christ")); requestWriter.Write("&{0}={1}", HttpUtility.UrlEncode("Password"), HttpUtility.UrlEncode("christ123")); } using (StreamReader responseReader = new StreamReader(myRequest.GetResponse().GetResponseStream())) // here throws internal error. it is not going inside this function. { result = responseReader.ReadToEnd(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)