Results 1 to 10 of 10

Thread: Updating time from the internet.

  1. #1

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Updating time from the internet.

    Hello,

    How do I make my program get the time from an internet server such as
    time.windows.com?

    Thank you!
    Stilekid007

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Updating time from the internet.

    I assume the INet control... You download the webpage source and parse out the time? Just guessing though...


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Updating time from the internet.

    VB Code:
    1. Option Explicit
    2. Dim cat() As String
    3.  
    4. Private Sub Form_Load()
    5. Dim x As String, i As Integer
    6. x = Inet1.OpenURL("http://tycho.usno.navy.mil/cgi-bin/timer.pl", icString)
    7.     cat() = Split(x, "<BR>") 'Chr(48))
    8.         For i = 0 To UBound(cat)
    9.             If i <> 0 And InStr(cat(i), "HR") = 0 Then
    10.         Text1.Text = Text1.Text & cat(i) & vbNewLine
    11.             End If
    12.         Next
    13. End Sub

    Time.windows.com doesnt accept 3rd party requests on their website (even web browsers) so you have to use this ^^

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Updating time from the internet.

    These examples might help:
    Example1
    Example2
    Example3
    Example4
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Re: Updating time from the internet.

    Hello, 2eMix, I just could not get your code to work! lol I had a couple errors. I fixed a couple and then I get a variable error on the Inet1.

    DEE-U - Thank you so much for the helpfull examples! I am looking at the source code right now to 3 of them that look like they will have the exact code I need!

    I really appreciate your time in getting those!

    I will let you know if those examples have the right code.

    Thank you!
    Stilekid007
    Quote Originally Posted by stilekid007
    I RATE ALL HELPFULL POSTS!

  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Updating time from the internet.

    Nothing much to do, my boss is still not around.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  7. #7

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Re: Updating time from the internet.

    Haha! great!
    Quote Originally Posted by stilekid007
    I RATE ALL HELPFULL POSTS!

  8. #8
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Updating time from the internet.

    for remix's example, you need to add the Internet Transfer Control, and a multiline textbox. You also need to add the vbcrlf's to the end of the lines.
    it returns times accross the US and GMT.
    Attached Files Attached Files

  9. #9
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Updating time from the internet.

    yeah i figured youd know to use the inet control, and it does work perfect ; )

  10. #10

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Re: Updating time from the internet.

    Hey guys that works pretty nice! Now I see how the Inet works.

    Is there anyother time update server I could use? Because I did only want one time in the text box. If not that is fine becuase I could make this work to. Just checking.

    Thank you so much for the code it all works very good!
    Stilekid007
    Quote Originally Posted by stilekid007
    I RATE ALL HELPFULL POSTS!

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