在Windows 10中使用vb6进行webautomation时出错

前端之家收集整理的这篇文章主要介绍了在Windows 10中使用vb6进行webautomation时出错前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在自动化网站以填写登录详细信息.我已经在vb6中开发了这个应用程序,并且在 Windows XP,7和8中运行得非常好.现在它在Windows 10中出错了.
在Windows 10中,当我直接运行exe时,登录详细信息没有填充.(我收到“OnQuit”消息).但是,当我以管理员身份运行exe时,它可以正常工作.
这是vb6代码,

Private Sub Form_Load()

    Set Web = New SHDocVw.InternetExplorer
    Web.Visible = True
    Web.Navigate "https://mytestingsite/login.html ",8
End Sub
Private Sub Web_DocumentComplete(ByVal pDisp As Object,URL As Variant)
On Error GoTo aaa
    'MsgBox "   URL: " & URL
    If URL = "https://mytestingsite/login.html" Then
    Web.Document.getElementById("Login_userName").Value = "abcd"
    Web.Document.getElementById("Login_userName").onchange
    Web.Document.getElementById("Login_password").Value = "123456789"
    Web.Document.getElementById("dateField").Value = "15/09/1954"
    End If
Exit Sub
aaa:
MsgBox Err.Description & "   URL: " & URL
End Sub
Private Sub Web_OnQuit()
    MsgBox "OnQuit fired"
End Sub

我的问题是为什么简单的Web自动化需要以管理员身份运行?
是否无法在Windows 10中的标准用户中运行应用程序?
如何解决这个问题呢 ?

请不要建议我在.net中重建应用程序(将我的应用程序转换为.net需要很长时间)

解决方法

快速解决您的问题的方法是发布清单和.exe

这里描述:
How do I create a manifest file in Visual Basic 6.0?

猜你在找的Windows相关文章