Inet?

Can console apps have an Inet
If so whats code to add and use, or if there is none whats an alternative


Answer this question

Inet?

  • Alex Yakhnin - MSFT

    I am not trying to do that, it's to check for updates, the inet1 was for VB6 also. Any ideas

  • chipso4

    Gots no idea how to use that, I am noob. How EXACTLY would I use to make it check for updates

  • 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.

    http://msdn2.microsoft.com/en-us/library/system.net.webresponse.aspx

    http://msdn2.microsoft.com/en-us/library/system.net.webrequest.aspx

     

    looking at your VB6 code etc... I think this would be what you are after.



  • 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

     ahmedilyas wrote:

    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

  • KAAU

    you need to import the System.Net namespace as well as System.IO

  • ericzaj

    I need like exact code here.
    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

    Here was my code in VB6:

    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:

  • 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



  • 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

    Thanks alot, help with other post

  • 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.



  • Inet?