POST/GET from windows form

G

Guest

Hi everyone,
I need to pass a series of parameters to an SMS gateway from a client
application, a windows form application. The question is, HOW?
Is it possible to POST/GET data from a windows form?
Do people use Remoting or Socket to this pourpose?
Thanks a lot.
 
V

Vadym Stetsyak

No need to use sockets directly. ::cool:

You can use HttpWebRequest class, which is located in System.Net namespace.

send request to the server, using HTTP protocol

//send request
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create(http://smsgate.net);

//get response
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse ();

watch the docs for the details.
 
G

Guest

Thanks Vadmyst,

all more clear, now!

Matteo

Vadym Stetsyak said:
No need to use sockets directly. ::cool:

You can use HttpWebRequest class, which is located in System.Net namespace.

send request to the server, using HTTP protocol

//send request
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create(http://smsgate.net);

//get response
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse ();

watch the docs for the details.
 
J

Joerg Jooss

Vadym said:
No need to use sockets directly. ::cool:

You can use HttpWebRequest class, which is located in System.Net
namespace.

send request to the server, using HTTP protocol

//send request
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create(http://smsgate.net);

//get response
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse ();

watch the docs for the details.

You can use System.Net.WebClient as well, which is more user-friendly
for basic HTTP operations.

Cheers,
 

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