我用VB写了个OCX在ASP(IE:假设是1.asp)中调用,点击OCX中某个按钮,将打开新浪网。我用的是Api Shell.... (具体记不清了)打开,可是打开后把我的当前页取代了。我的意思是我要在VB代码中打开一个新的网页并且可以自定义网址。加分!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

解决方案 »

  1.   

    用脚本写
    <script language="JavaScript">
    window.open('http://www.sina.com.cn','','toolbar,menubar,scrollbars,resizable,status,location,directories,copyhistory,height=3000,width=3000');
    </script>
      

  2.   

    打开VB菜单的 Project(项目)|References(引用) 项,在References对话框中有一个Microsoft Internet Control项,选中它,然后在Form1中加入一个CommandButton,在Form1中加入一下代码: 
        'Dim dWinFolder As ShellLinkObject 
        Dim dWinFolder As ShellWindows 
         
        Private Sub Command1_Click() 
         bBrowser = False 
         If dWinFolder.Count = 0 Then 
         '没有打开的浏览器窗口,执行常规的ShellExecute 打开网页 
         Else 
         dWinFolder.Item(0).Navigate "http://www.sina.com.cn", navOpenInNewWindow, _ 
         "_blank", 0, 0 
         End If 
        End Sub 
         
        Private Sub Form_Load() 
         Set dWinFolder = New ShellWindows 
        End Sub 
         
        Private Sub Form_Unload(Cancel As Integer) 
         Set dWinFolder = Nothing 
        End Sub 
        运行程序,就可以在新窗口中打开了。ShellWindows对象是Windows下运行的所有外壳浏览器的集合。 
      

  3.   

    引用 Microsoft Internet Controls
    然后创建新的IE窗口:    Dim IE As New InternetExplorer
        
        IE.Visible = True
        IE.Navigate "http://www.applevb.com"
      

  4.   

    shell "explorer.exe path & 1.asp"