'http://community.csdn.net/Expert/topic/3249/3249571.xml?temp=.6271936 '打开VB,在工程中引用Microsoft internet controls: Private Function Str()as string Dim IEList As New ShellWindows Dim browser Dim Doc '遍历当前地浏览器窗口 For Each browser In IEList '找到需要地IE窗口 If browser.Document.Title = "testPage" Then '获得浏览器地文档对象 Set Doc = browser.Document dim ss ss=Doc.body.All("LoginName").Value End If Next Str=ss End Sub
是啊,从ASP到VB,我用了一种方法是<script language="VBScript"> function fnShellExecuteVB() dim objShell set objShell = CreateObject("Shell.Application") objShell.ShellExecute "notepad.exe", "", "", "open", 1 set objShell = nothing end function </script>但是ShellExecute只能在WIN2000下使用
'打开VB,在工程中引用Microsoft internet controls:
Private Function Str()as string
Dim IEList As New ShellWindows
Dim browser
Dim Doc
'遍历当前地浏览器窗口
For Each browser In IEList
'找到需要地IE窗口
If browser.Document.Title = "testPage" Then
'获得浏览器地文档对象
Set Doc = browser.Document
dim ss
ss=Doc.body.All("LoginName").Value
End If
Next
Str=ss
End Sub
function fnShellExecuteVB()
dim objShell set objShell = CreateObject("Shell.Application") objShell.ShellExecute "notepad.exe", "", "", "open", 1 set objShell = nothing
end function
</script>但是ShellExecute只能在WIN2000下使用