vb6使用默认浏览器打开网站

| |
[不指定 2019/08/24 14:48 | by admin ]
1、这里介绍vb打开网站问题,用最简单的方式打开杀毒一般都拦截,例如
Shell "explorer.exe http://163.com"

2、其中shell函数调用执行一个可执行文件explorer.exe所以这种最方便的打开方式会被提示拦截询问,下面代码可以直接打开不提示,相对可靠些。

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()
ShellExecute 0, "open", "http://163.com", 0, 0, 1
End Sub
程序源码 | 评论(0) | 引用(0) | 阅读(183)