VB中如何打开IE并且访问指定的网页?高手指教!
发布网友
发布时间:2023-10-14 07:32
我来回答
共2个回答
热心网友
时间:2024-12-12 18:00
可以不使用api函数.
直接使用 shell 这个内部函数就可以了
'---------------------------
apath = "C:\Program Files\Internet Explorer\iexplore.exe"
bpath="你要打开的网页地址"
shell apath & " " & bpath,vbNormalFocus
'-------------------------------
热心网友
时间:2024-12-12 18:00
API
Public 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
Dim fg As String
fg = "http://www.walkstudent.net"
ret& = ShellExecute(Me.hwnd, "Open", fg, "", App.Path, 1)