HtmlDocumentExtensionsGetCookieCollection Method
Gets a CookieCollection containing the stored cookies in the source Document.
Namespace: DevCase.Extensions.HtmlDocumentExtensionsAssembly: 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 CookieCollection GetCookieCollection(
this HtmlDocument sender
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function GetCookieCollection (
sender As HtmlDocument
) As CookieCollection
Dim sender As HtmlDocument
Dim returnValue As CookieCollection
returnValue = sender.GetCookieCollection()
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static CookieCollection^ GetCookieCollection(
HtmlDocument^ sender
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member GetCookieCollection :
sender : HtmlDocument -> CookieCollection
No code example is currently available or this language may not be supported.
- sender HtmlDocument
-
The source HtmlDocument.
CookieCollection
The resulting
CookieCollection.
In Visual Basic and C#, you can call this method as an instance method on any object of type
HtmlDocument. 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 CookieCollection = GetCookieCollection(wb.Document)
For Each cookie As Cookie In cookies
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.