1
Web platform / Re: C# GUI interface to Web Server
OK I now have a very basic version working, below is the code for the button click event handler:
private void button1_Click(object sender, EventArgs e)
{
// In this method you need to set up an event
int count;
byte[] buffer = new byte[8192];
// create the request
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://192.168.0.5/leds.cgi?led=1");
// send request & get a response
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// process the response
Stream responseStream = response.GetResponseStream();
count = responseStream.Read(buffer, 0, buffer.Length);
response.Close();
}
Now I can toggle LED2 via a simple windows application. The learning continues :)
Regards
Kevin