Results 1 to 8 of 8

Thread: Two VB6 questions.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    109

    Two VB6 questions.

    1. How do I add/remove sections of a string? Like remove anything after "BC" in a string like "ABCDEFG".

    2. How do I ping a website, like google.com, and get its IP address?

  2. #2

  3. #3

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    109

    Re: Two VB6 questions.

    Thanks, I got that working. Now how do I manipulate strings (like in question 1).

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Two VB6 questions.

    Well, there are dozen of ways so try this one:
    VB Code:
    1. Private Sub Command2_Click()
    2. Dim strText$, strFind$
    3.  
    4.     strText = "ABCDEFG"
    5.     strFind = "BC"
    6.    
    7.     Debug.Print Left(strText, InStr(1, strText, strFind) + Len(strFind) - 1)
    8.  
    9. End Sub

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    109

    Re: Two VB6 questions.

    So one more question. How would I make a browser (MS internet tools) go to the IP address of a link, instead of the host name. For example, if you are at "site.com", I set it to get its IP address and go to it. So far that works as planned. Now, if you click a link that leads to "site.com/page.html", how would I make it go to "###.###.###.###/page.html"?

  7. #7

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Two VB6 questions.

    Quote Originally Posted by zach1188
    So one more question. How would I make a browser (MS internet tools) go to the IP address of a link, instead of the host name.
    Since all internet addressing is by IP address, you just give it the host name. Your computer will go to its DN server (it gets that server's address when you connect to the internet) and request the IP address, then go to the IP address. Host names (canonical addresses) are merely aids for human beings - computers use IP addresses.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

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