I’ll explain. string content is an html code. Using that code I can create an interface (buttons and other stuff.) How can I send back the data I’ve collected in order to control the gadgeteer? (Turning the led on for example)
The code:
public partial class Program
{
GT.Networking.WebEvent sayHello;
void ProgramStarted()
{
ethernet.UseDHCP();
ethernet.NetworkUp += new GTM.Module.NetworkModule.NetworkEventHandler(ethernet_NetworkUp);
}
void ethernet_NetworkUp(GTM.Module.NetworkModule sender, GTM.Module.NetworkModule.NetworkState state)
{
string ipAddress = ethernet.NetworkSettings.IPAddress;
WebServer.StartLocalServer(ipAddress, 80);
sayHello = WebServer.SetupWebEvent("hello");
sayHello.WebEventReceived += new WebEvent.ReceivedWebEventHandler(sayHello_WebEventReceived);
}
void sayHello_WebEventReceived(string path, WebServer.HttpMethod method, Responder responder)
{
string content = "<html><body><h1>Hello World!!</h1></body></html>";
byte[] bytes = new System.Text.UTF8Encoding().GetBytes(content);
responder.Respond(bytes, "text/html");
}
Thanks in advance !!!