请问怎么在vb中打开本地文件夹中的网页呢
看看这个贴 http://bbs.bc-cn.net/bbs/dispbbs.asp?BoardID=6&ID=1260
或者看代码 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 Const SW_SHOWNORMAL = 1
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Label1.FontUnderline = False Label1.ForeColor = vbBlack End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Label1.FontUnderline = True Label1.ForeColor = vbBlue End Sub
Private Sub Label1_Click() ShellExecute Me.hWnd, vbNullString, "http://www.csdn.net", vbNullString, vbNullString, SW_SHOWNORMAL End Sub ShellExecute 是个API函数,可以使用默认程序打开各种格式的文件,你只要把上面的 http://www.csdn.net 换成你要打开的文件路径就可以了。