' Получение Cookies сайта
Public Function GetCookies(sUrl As String) As CookieContainer
Dim oVisitor As clsCookie, oCookieManager As Object, oCookie As CookieContainer
oVisitor = New clsCookie() ' Получение текущих cookie
oCookieManager = WebView.GetCookieManager
If oCookieManager.VisitUrlCookies(sUrl, True, oVisitor) Then oVisitor.WaitForAllCookies()
oCookie = New CookieContainer
For Each nameValue In oVisitor.NamesValues ' Cookie в одну строку
Application.DoEvents()
oCookie.Add(New Uri(sUrl), New Net.Cookie(nameValue.Item1, nameValue.Item2))
Debug.WriteLine("oCookie.Add(New Uri(""" & sUrl & """), New Cookie(""" & nameValue.Item1 & """, """ & nameValue.Item2 & """))")
Next
Return oCookie
End Function