Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - M0KHZ

1
Web platform / Re: C# GUI interface to Web Server
Update (& a happy man)....

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
2
Web platform / C# GUI interface to Web Server
Having great fun (and learning) from the Web Server platform - here on my bench for the last 4 days :), my thoughts are now turning towards a Windows GUI interface to toggle LED2, plus anything else I hang off the header.

I’m guessing a GUI button could ‘talk’ to the server via http, has anyone tried this?
Has anyone any pointers as how to implement this?

At the moment I have a new C# project started, a single button on Form1, but have NO idea what needs to go into the event handler for the button :)

Regards
Kevin

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01252279616session_write_close ( )...(null):0
20.01282411216ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01282411992Database_MySQL->query( ).../DatabaseHandler.php:119
40.05872550728Database_MySQL->error( ).../Db-mysql.class.php:273