what was Inet1 What control was this the WebBrowserControl has Navigate() not OpenURL.
if you are trying to view the contents of webpage in a console app - it is not going to happen - the only thing you would probably see is to direct the output from the documentstream to the console app which would contain just the html text
what exactly do you mean by "check for updates" this is entirely something you would have to do since its something you have developed yourself.
Give a scenario including steps on what would happen if they "check for updates" and what is expected from it and hopefully we will try our best to explain/give the appropriate solution
I would highly suggest you redesign your update system using webservices but I guess this may not be a solution for you so I will try to explain how to use the requested methods to do your task:
connect to the website
get data from the page shown/navigated to
if text matches "Version 5.0" then display "No new updates available"
else display "There is an update"
Dim theRequest as WebRequest = WebRequest.Create("http://goat-spirit.com/Files/VER.VER")
Dim theWebResponse as WebResponse = theRequest.GetResponse()
using theStreamReader as new StreamReader(theResponse.GetResponseStream())
if theStreamReader.ReadLine().Trim.ToLower().Contains("version 5.0") = true then
Console.WriteLine("No new updates")
else
Console.WriteLine("There is an update")
end if
end using
Dim input as String = Console.ReadLine() 'just for polling/waiting purpose to display the message without it appearing and disappearing
does this help This will only read that first line of the response
Says both Web's are not defined as well as stream thing. Whats the code I define
define Inet. you mean internet webbrowser control in which case not quite - you *could* add a reference to System.Windows.Forms, then import it and create an instance of it programmatically and implement all events etc.... However there was a reason for not putting this in the Console apps.
Inet1.OpenURL("http://goat-spirit.com/Files/VER.VER") If Inet1.OpenURL("http://goat-spirit.com/Files/VER.VER") = "Version 5.0" Then Text1.Text = "No new updates" Else Text1.Text = "There is an update"
I would highly suggest you redesign your update system using webservices but I guess this may not be a solution for you so I will try to explain how to use the requested methods to do your task:
connect to the website
get data from the page shown/navigated to
if text matches "Version 5.0" then display "No new updates available"
else display "There is an update"
Dim theRequest as WebRequest = WebRequest.Create("http://goat-spirit.com/Files/VER.VER")
Dim theWebResponse as WebResponse = theRequest.GetResponse()
using theStreamReader as new StreamReader(theResponse.GetResponseStream())
if theStreamReader.ReadLine().Trim.ToLower().Contains("version 5.0") = true then
Console.WriteLine("No new updates")
else
Console.WriteLine("There is an update")
end if
end using
Dim input as String = Console.ReadLine() 'just for polling/waiting purpose to display the message without it appearing and disappearing
does this help This will only read that first line of the response
they can be done on a console app - since its a WebRequest/Response - just import the System.Net namespace and that's it. As well as this, you are not exactly showing the page, but rather reading the stream response (textual).
Please feel free to contribute your method of doing this!
Inet?
Alex Yakhnin - MSFT
chipso4
wappie
well VB6 and .NET are different.
the other thing I can suggest is to use WebRequest/WebResponse classes to get your stream of data.
MateuszKierepka
what was Inet1 What control was this the WebBrowserControl has Navigate() not OpenURL.
if you are trying to view the contents of webpage in a console app - it is not going to happen - the only thing you would probably see is to direct the output from the documentstream to the console app which would contain just the html text
Krad
what exactly do you mean by "check for updates" this is entirely something you would have to do since its something you have developed yourself.
Give a scenario including steps on what would happen if they "check for updates" and what is expected from it and hopefully we will try our best to explain/give the appropriate solution
steve_h
Says both Web's are not defined as well as stream thing. Whats the code I define
KAAU
ericzaj
Mine in a windows form was:
Inet1.OpenURL("http://blah.com/blah.txt")
Text1.Text = Inet1.OpenURL("Same as above^")
lahaha
define Inet. you mean internet webbrowser control in which case not quite - you *could* add a reference to System.Windows.Forms, then import it and create an instance of it programmatically and implement all events etc.... However there was a reason for not putting this in the Console apps.
sydes141
Inet1.OpenURL("http://goat-spirit.com/Files/VER.VER")
If Inet1.OpenURL("http://goat-spirit.com/Files/VER.VER") = "Version 5.0" Then Text1.Text = "No new updates" Else Text1.Text = "There is an update"
I need that for a console app. 0.0
RayClark096
I would highly suggest you redesign your update system using webservices but I guess this may not be a solution for you so I will try to explain how to use the requested methods to do your task:
Dim theRequest as WebRequest = WebRequest.Create("http://goat-spirit.com/Files/VER.VER")
Dim theWebResponse as WebResponse = theRequest.GetResponse()
using theStreamReader as new StreamReader(theResponse.GetResponseStream())
if theStreamReader.ReadLine().Trim.ToLower().Contains("version 5.0") = true then
Console.WriteLine("No new updates")
else
Console.WriteLine("There is an update")
end if
end using
Dim input as String = Console.ReadLine() 'just for polling/waiting purpose to display the message without it appearing and disappearing
does this help This will only read that first line of the response
Sidambara raja
they can be done on a console app - since its a WebRequest/Response - just import the System.Net namespace and that's it. As well as this, you are not exactly showing the page, but rather reading the stream response (textual).
Please feel free to contribute your method of doing this!
:-)
arthurmnev
Onlinemercenary
ahmedilyas ,
Correct me if I'm wrong. But the things he is trying to do,
and your suggested techniques can not be done in a console app.