使用2个WebBrowser控件登录多个Gmail账户的.NET实现

4
我有一个带有两个选项卡的选项卡控件,每个选项卡上都有一个WebBrowser控件。 我想在它们上面显示2个不同的Gmail帐户,但是一旦我通过WebBrowser1登录,WebBrowser2也会登录。
有没有一种方法可以实现我想要的效果?

1
这种行为在普通浏览器中是否可能?在两个不同的选项卡中同时登录两个不同的Gmail帐户? - froeschli
1
Gmail 的设计本身在很大程度上防止这种方法奏效。 - Gabe
3个回答

1

我认为以你现在的尝试方式是不可能实现的......因为Webrowser组件是你系统中的Internet Explorer

你可以在第二个选项卡中使用Gecko


0

IE 8在UI中提供了“新会话”功能。我想象这个功能也可以在你自己的UI中实现。请参阅this article,了解它在UI中的工作原理。搜索Web浏览器控件文档,找到实现相同功能的方法。


0

这里有一些代码,可以让您访问InPrivate IE

Friend Function Open(Optional ByVal Url As String = "about:blank", Optional ByVal WindowState As ProcessWindowStyle = ProcessWindowStyle.Hidden) As WebBrowser
On Error Resume Next

Dim Start As New ProcessStartInfo
Dim Windows = New ShellWindowsClass
Dim Count = Windows.Count
Start.FileName = "iexplore.exe"
Start.Arguments = "-private -nomerge " & Url
If WindowState = ProcessWindowStyle.Hidden Then
  Start.WindowStyle = ProcessWindowStyle.Minimized
Else
  Start.WindowStyle = WindowState
End If
Process.Start(Start)

Wait.Reset()
Do
  If Windows.Count > Count Then Exit Do
Loop While Wait.Waiting

Browser = Windows(Count)
Browser.Visible = (WindowState <> ProcessWindowStyle.Hidden)
Return Browser
End Function

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接