|
-
Nov 7th, 2009, 07:45 AM
#1
Thread Starter
New Member
[RESOLVED] How to open website
Hallo to all, I would like to ask a simple code on how to open a website using a specific IP Address like 125.168.0.1 will open the "http://www.google.com" using VB 6, thank you so much.
-
Nov 7th, 2009, 08:03 AM
#2
Re: How to open website
vb Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Dim lngOpenPage As Long
lngOpenPage = ShellExecute(Form1.hwnd, "Open", "125.168.0.1", 0&, 0&, 0&)
End Sub
-
Nov 7th, 2009, 11:35 AM
#3
Junior Member
Re: How to open website
UPDATED GOOGLE IP
Just put one command button on form and name it command1, copy,past this code in, run program. tested good
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Dim lngOpenPage As Long
lngOpenPage = ShellExecute(Form1.hwnd, "Open", "http:\\74.125.53.100", 0&, 0&, 0&)
End Sub
-
Nov 7th, 2009, 10:33 PM
#4
Thread Starter
New Member
Re: How to open website
Thank you so much. . .I would like to ask what is ( 0&, 0&, 0& ) and (Form1.hwnd) means?
-
Nov 8th, 2009, 07:33 AM
#5
Re: How to open website
0& means 0, the & just forces it to be a particular data type. If you want more information, see the article about it in the "Language Syntax" section of our Classic VB FAQs
hWnd is a unique reference to a window (in this case your form) that Windows assigns. It does that for every window on the screen (including lots that you wouldn't think are windows) so that it can interact with them as needed.
-
Nov 8th, 2009, 07:01 PM
#6
Thread Starter
New Member
Re: How to open website
Now I understand, the code you gave me worked well. I got 2 IP Address 192.168.1.1 which I am using now and 192.168.0.1 as my backup IP Address. I want to open the "www.yahoo.com" using my backup IP Address which is 192.168.0.1 without changing my TCPIP which is 192.168.1.1. How to do that? Please help me, this is a big thesis defense. Thank you soooooo much. . .
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|