inet component

  • Thread starter Dino Chiesa [Microsoft]
  • Start date
D

Dino Chiesa [Microsoft]

If what you want to do is programmatically post to a web page, then
System.Net.WebRequest will do it.

This is not VB.NET, but you get the idea:

private static string PostURI(string URI, string Parameters)
{
string CommandURI = URI;
WebRequest myWebRequest = WebRequest.Create(CommandURI);

//needed only if outbound traffic must go through a proxy server
//WebProxy proxyObject = new WebProxy("http://proxyserver:80/",true);
//myWebRequest.Proxy = proxyObject;

myWebRequest.ContentType = "application/x-www-form-urlencoded";
myWebRequest.Method = "POST";
byte [] bytes = System.Text.Encoding.ASCII.GetBytes(Parameters);
myWebRequest.ContentLength = bytes.Length;
Stream OutputStream = myWebRequest.GetRequestStream ();
OutputStream.Write (bytes, 0, bytes.Length);
OutputStream.Close ();
WebResponse MyWebResponse = myWebRequest.GetResponse();
Stream MyStream = MyWebResponse.GetResponseStream();
StreamReader MyStreamReader = new StreamReader(MyStream);
return MyStreamReader.ReadToEnd().Trim();
}


usage:

String sPostData= "Argument1=" + sData + "&Argument2=SomethingElse";
String sResultHtml= PostURI("http://server/something/something",
sPostData);
 
Y

Yusuf

ý m using visual basic.net but inet(internet transfer control) comp. don't
have in my dot.net
ý have to inet comp. because I must send data a web pages with post method..
and. I don' t have webbrowser in my dot.net. where can I find?

and

how is send data a web pages with post method..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top