请帮我写一个,VB程序
当运行程序后,自动写入cookie值:
用户名:中国重庆
密码:chongqing
并打开一个网页,如:http://www.baidu.com
且网页处于全屏状态(没有标题栏、工具栏、按钮栏、地址栏等),即除了网页内容其它的都不要。谢谢各位!

解决方案 »

  1.   

    不需要按钮打开
    直接运行VB所生成的exe文件,就打开网页
      

  2.   

    你这是叫cookie么....这是用户名和密码.一个会自动登录网站的登录器而已.
      

  3.   

    对啊!对啊...
    我就是这个意思,只要达到效果,也可以不写cookie 直接登陆数据库也行
    用户名就用:中国北京
    密码:beijing还有,登击后一定得全屏啊谢谢各位了,我对VB实在不熟悉,又需要这个功能
    麻烦各位大侠
      

  4.   

    completed事件上写
    webbrowser.document.cookie="username:中国重庆;密码:chongqing"全屏使用api [DllImport("User32.dll")]
            public static extern IntPtr FindWindowEx(IntPtr ph, IntPtr ch, String cn, String wn);
            [DllImport("User32.dll")]
            public static extern bool ShowWindow(IntPtr hWnd, long nCmdShow);      IntPtr handle = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Shell_TrayWnd", null);c#代码 vb的自己找吧....
      

  5.   

    谢谢!
    但是,这能打开如http://www.baidu.com 的页面吗?
      

  6.   

    webbrowser.navigator="http://www.baidu.com" 具体的方法记不得了..你google vb webbrowser吧
      

  7.   

    看了一下http://dev.csdn.net/article/28/28374.shtm 这上面写的VB自动登陆,没想到还挺麻烦的!
    慢慢研究了
    但用VB实现全屏状态打开页面,好像不行啊?
    求助啊...
      

  8.   

    监听数据,
    inet发包,或者webbrowser好像也行.
    全屏,你用webbrowser后按f11试试.记得可以直接全屏
      

  9.   

    我用这种方法,但不能实现自动登陆,还得点击login.asp页面的登陆按钮才行!请问如何实现不用点击,一运行程序就登陆呢?Private Sub Form_Load()   '打开登陆页面
       WebBrowser1.Navigate "http://192.168.1.4/weblogin/login.asp"
    End Sub
    Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Dim vDoc, vTag
    Dim i As Integer    Set vDoc = WebBrowser1.Document
        If vDoc Is Nothing Then Exit Sub
        For i = 0 To vDoc.All.length - 1
            If UCase(vDoc.All(i).tagName) = "INPUT" Then ' 查找Object属性为Input的可输入项
               Set vTag = vDoc.All(i)
               If LCase(vTag.Type) = "text" Or LCase(vTag.Type) = "password" Then
                  Select Case LCase(vTag.Name)
                         Case "username" '如果是用户名的那个框
                              vTag.Value = "临江" '这个是用户名
                         Case "password"
                              vTag.Value = "123456" '这个是密码
                  End Select
                  
                  With vDoc.All(i)
                       If UCase$(.tagName) = "INPUT" Then ' 查找Object属性为Input的可输入项
                             .Click  '模拟鼠标单击
                       End If
                  End With
               End If
            End If
        Next
        
    End Sub
      

  10.   

    我用这种方法,但不能实现自动登陆,还得点击login.asp页面的登陆按钮才行!请问如何实现不用点击,一运行程序就登陆呢? 
    登陆按钮也可以用webbrowser控制document.getelementByid(按钮id).click()
      

  11.   

    谢谢各位!
    已解决
    现贴出来与大家分享一下成果吧:
    Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    Private Const a& = -1
    Private Const b& = &H1
    Private Const c& = &H2Private Sub Form_Load()
       WebBrowser1.Silent = True '禁止webbrowser控件打开网页出现“脚本错误”
       
       '下面二句是form全屏
       Me.WindowState = 0
         Me.Move 0, 0, Screen.Width, Screen.Height
         'WebBrowser1大小
         SetWindowPos Me.hwnd, a, 0, 0, 0, 0, b Or c
         Me.Left = Screen.Width / 2 - Me.Width / 2
         Me.Top = Screen.Height / 2 - Me.Height / 2
         WebBrowser1.Left = 0
         WebBrowser1.Top = 0
         WebBrowser1.Width = Me.Width
         WebBrowser1.Height = Me.Height
       '打开登陆页面
       WebBrowser1.Navigate "http://192.168.1.4/weblogin/login.asp"
    End Sub
    Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Dim vDoc, vTag
    Dim i As Integer    Set vDoc = WebBrowser1.Document
        If vDoc Is Nothing Then Exit Sub
        For i = 0 To vDoc.All.length - 1
            If UCase(vDoc.All(i).tagName) = "INPUT" Then ' 查找Object属性为Input的可输入项
               Set vTag = vDoc.All(i)
               If LCase(vTag.Type) = "text" Or LCase(vTag.Type) = "password" Then
                  Select Case LCase(vTag.Name)
                         Case "username" '如果是用户名的那个框
                              vTag.Value = "临江" '这个是用户名
                         Case "password"
                              vTag.Value = "123456" '这个是密码
                  End Select
                  '自动登陆
                 If Not (WebBrowser1.Document Is Nothing) Then
                    If Not (WebBrowser1.Document.Body Is Nothing) Then
                      If Not (Me.WebBrowser1.Document.Body.All("send") Is Nothing) Then
                              Call Me.WebBrowser1.Document.Body.All("send").Click
                      End If
                    End If
                 End If
               End If
            End If
        Next
        
    End Sub
      

  12.   

    现结束这个贴了,但还有一个关于置顶窗口的小问题,另开一贴,望各位再帮助一下
    http://topic.csdn.net/u/20091123/09/6e31c696-e3ab-4cb9-8c2c-74f4a44fe1f8.html