Just use HttpWebRequest ... works very well ... brief (and incomplete)
example follows :
StringBuilder formatData = new StringBuilder();
//put your post values into the string builder
HttpWebRequest http = (HttpWebRequest)WebRequest.Create(addr);
http.ContentType = "application/x-www-form-urlencoded";
http.ContentLength = formatData.Length;
http.Method = "POST";
Stream strWrite = http.GetRequestStream();
StreamWriter sw = new StreamWriter(strWrite);
sw.Write(formatData.ToString());
sw.Close();
//Now we need to read the data
WebResponse wr = http.GetResponse();
HttpWebResponse httpRes = (HttpWebResponse)wr;
Stream s = httpRes.GetResponseStream();
StreamReader sr = new StreamReader(s,Encoding.ASCII);
ret = sr.ReadToEnd();
sr.Close();
//Debug.WriteLine(ret)
"Ola" <an*******@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
I need to create a web client code in C# that retrieves data from a web
site. In VB I do the following: Set xmlHttp = WScript.CreateObject("Microsoft.XMLHTTP")
Set xmlDom = WScript.CreateObject("Microsoft.XMLDOM")
xmlDom.LoadXml("<DETAILS FirstName=""John"" LastName=""James"" />")
xmlHttp.Open "POST", "http://host/rocet/Purschase.aspx", 0
xmlHttp.Send(xmlDom)
A pointer to equivalent process in C# will be appreciated.
Ola.