LarsK
Active Member
Hi, I have developed a demo for communicating with WC8 using VB.Net. Program is compiled in VB Express 2008.
This demo asks for Temp sensor #1 value.
Code:
Imports System.Net
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim inStream As StreamReader
Dim webRequest As WebRequest
Dim webresponse As WebResponse
' webRequest = webRequest.Create(TextBox1.Text)
' You can choose to use a textbox with the IP adress if you want to as well.
webRequest = webRequest.Create("http://192.168.0.10/gett1.cgi") ' Remember: Edit IP Adress if needed
webresponse = webRequest.GetResponse()
inStream = New StreamReader(webresponse.GetResponseStream())
TextBox2.Text = inStream.ReadToEnd()
End Sub
End Class
I have added the souce code for download.
Link: Check post #5. New scriptfile.
Here is the program and the webpage showing temp sensor #1:
This demo asks for Temp sensor #1 value.
Code:
Imports System.Net
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim inStream As StreamReader
Dim webRequest As WebRequest
Dim webresponse As WebResponse
' webRequest = webRequest.Create(TextBox1.Text)
' You can choose to use a textbox with the IP adress if you want to as well.
webRequest = webRequest.Create("http://192.168.0.10/gett1.cgi") ' Remember: Edit IP Adress if needed
webresponse = webRequest.GetResponse()
inStream = New StreamReader(webresponse.GetResponseStream())
TextBox2.Text = inStream.ReadToEnd()
End Sub
End Class
I have added the souce code for download.
Link: Check post #5. New scriptfile.
Here is the program and the webpage showing temp sensor #1: