Results 1 to 5 of 5

Thread: .OCX Challenge

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    7

    .OCX Challenge

    Hi there,

    I have a BIG question to you guys.

    I want to make a programma that will show in a label information that has been get from the internet.
    ------------------------------------------------------
    The thing is called METAR (thats just the name) and it provides a weather info from airports to a pilot.

    I searched the net and i found that I need the msinet.ocx file with the relating code :

    Let MyMETAR = Inet1.OpenURL("http://weather.noaa.gov/pub/data/observations/metar/stations/" & UCase(station) & ".TXT")
    Let lblMETAR.Caption = MyMETAR

    This is where the info shall be get from :
    http://weather.noaa.gov/pub/data/obs...tions/XXXX.TXT
    the XXXX at the end is the option that should be select in a combobox

    ex.
    Case is EBBR
    then
    http://weather.noaa.gov/pub/data/obs...tions/EBBR.TXT

    where 'station' is the airport code (selected in a combobox ) and Inet1 is the name of the inet object of the form...

    ------------------------------------------------------
    Now I have an experience with OOP but not that much and i'm using VB.net 2005

    Does someone please can help me to show that info in a label when it has been selected in a combobox

  2. #2
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: .OCX Challenge

    Create an HTML reader to pull in the source code of that page, then drop the data into a label. Piece of cake.

  3. #3
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: .OCX Challenge

    To download and show the information in a lable, you'd use the Net.WebClient class.

    VB.Net Code:
    1. Using wc As New Net.WebClient
    2.             Label1.Text = wc.DownloadString("http://weather.noaa.gov/pub/data/observations/metar/stations/EBBR.TXT")
    3.         End Using
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    7

    Re: .OCX Challenge

    wow,

    thx both for replying that fast!

    I now will check the info

    thanks!

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    7

    Re: .OCX Challenge

    Oke it works but I have a lot of ICAO codes that can be selected in the combox. Thats why I tried this :

    Dim strICAOcode As String

    strICAOcode = cboMETAR.SelectedItem

    Using wc As New Net.WebClient
    lblMETAR.Text = wc.DownloadString("http://weather.noaa.gov/pub/data/observations/metar/stations/" & strICAOcode & ".TXT")
    End Using

    Now that doesn't work,the URL is wrong, is there another way to do something like this or do i need to put al the diffirent cbo options in a case ?

    greets
    Last edited by Commadore4eva; Jun 21st, 2007 at 08:43 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width