WebBrowserExtensionsGetCookieContainer Method
Gets a CookieContainer containing the stored cookies for the active website
in the source WebBrowser.
(that is, the active opened document in the Document property).
Namespace: DevCase.Extensions.WebBrowserExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static CookieContainer GetCookieContainer(
this WebBrowser wb
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function GetCookieContainer (
wb As WebBrowser
) As CookieContainer
Dim wb As WebBrowser
Dim returnValue As CookieContainer
returnValue = wb.GetCookieContainer()
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static CookieContainer^ GetCookieContainer(
WebBrowser^ wb
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member GetCookieContainer :
wb : WebBrowser -> CookieContainer
No code example is currently available or this language may not be supported.
- wb WebBrowser
-
The source WebBrowser.
CookieContainer
The resulting
CookieContainer.
In Visual Basic and C#, you can call this method as an instance method on any object of type
WebBrowser. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Public Class Form1
Private uri As New Uri("https://foro.elhacker.net/")
Private Sub Form1_Shown(sender As Object, e As System.EventArgs) Handles MyBase.Shown
Me.WebBrowser1.ScriptErrorsSuppressed = True
Me.WebBrowser1.Navigate(uri)
End Sub
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Dim wb As WebBrowser = DirectCast(sender, WebBrowser)
If Not (wb.ReadyState = WebBrowserReadyState.Complete) OrElse Not (e.Url = Me.uri) Then
Exit Sub
End If
Dim cookies As CookieContainer = GetCookieContainer(wb)
For Each cookie As Cookie In cookies.GetCookies(Me.uri)
Console.WriteLine(cookie.ToString())
Next cookie
End Sub
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.