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?
Printable View
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?
Check out sample below (author: Randy Birch).
Resolve Host Name to IP Address
... as well as this one:
IcmpSendEcho: Ping a Machine by Host Name
Thanks, I got that working. Now how do I manipulate strings (like in question 1).
Well, there are dozen of ways so try this one:
VB Code:
Private Sub Command2_Click() Dim strText$, strFind$ strText = "ABCDEFG" strFind = "BC" Debug.Print Left(strText, InStr(1, strText, strFind) + Len(strFind) - 1) End Sub
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"?
Go back to Randy's site and find what you need - there are plenty of samples.
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.Quote:
Originally Posted by zach1188