Error with the wrapper mystical posted in "code snippet

Discussion in 'Code Snippets and Tutorials' started by test123, Feb 18, 2007.

  1. test123

    test123 Level IV

    Joined:
    Nov 3, 2006
    Messages:
    935
    Likes Received:
    0
    Location:
    Australia
    ok i put mystical's neopets login into my code and its all in there properly with no errors before executing the program but when i execute it and click my login button i get this error:

    on this line:

    Code (Text):
    1. ReqHeaders = "POST " + strFile + " HTTP/1.1" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Host: " + Host + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Language: en-us,en;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Encoding: gzip, deflate" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Keep-Alive: 300" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: keep-alive" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Referer: " + Referer + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Cookie: " + strCookies + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Type: application/x-www-form-urlencoded" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Length: " + strPost.Length.ToString + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: close" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + strPost
    can anyone help?
     
  2. expon

    expon Administrator
    Staff Member

    Joined:
    Oct 30, 2006
    Messages:
    1,393
    Likes Received:
    56
    Location:
    UK
    Not sure why that is but since then mystical has updated the wrapper and also I've updated it a bit so here's the updated version which you should try.. Obviously you'll need to change some of the names...

    Code (Text):
    1.  
    2. Imports System.Text.Regularexpressions
    3. Imports System.Net
    4. Imports System.IO
    5. Imports System.Text
    6. Imports System.IO.Compression
    7. Imports System.Runtime.Serialization.Formatters.Binary
    8. Public Class TCPWrapper
    9.     Inherits System.Windows.Forms.UserControl
    10. #Region " Windows Form Designer generated code "
    11.     Public Sub New()
    12.         MyBase.New()
    13.         'This call is required by the Windows Form Designer.
    14.         InitializeComponent()
    15.         'Add any initialization after the InitializeComponent() call
    16.     End Sub
    17.     'UserControl overrides dispose to clean up the component list.
    18.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    19.         If disposing Then
    20.             If Not (components Is Nothing) Then
    21.                 components.Dispose()
    22.             End If
    23.         End If
    24.         MyBase.Dispose(disposing)
    25.     End Sub
    26.     'Required by the Windows Form Designer
    27.     Private components As System.ComponentModel.IContainer
    28.     'NOTE: The following procedure is required by the Windows Form Designer
    29.     'It can be modified using the Windows Form Designer.
    30.     'Do not modify it using the code editor.
    31.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    32.         components = New System.ComponentModel.Container
    33.     End Sub
    34. #End Region
    35.     Private colCookies As New Collection
    36.     Dim strCookies As String
    37.     Public LastPage As String
    38.     Public bGzip As Boolean
    39.     Public Function Request(ByVal Method As String, ByVal URL As String, ByVal Referer As String) As String
    40.         Dim Host As String = Nothing
    41.         Dim strFile As String = Nothing
    42.         Dim strPost As String = Nothing
    43.         Dim pos As Integer = 0
    44.         If Referer Is Nothing Then
    45.             Referer = LastPage
    46.         End If
    47.         If URL.Contains("http://") Then
    48.             Host = URL.Substring(7)
    49.         Else
    50.             Host = URL
    51.         End If
    52.         If Host.Contains("/") Then
    53.             pos = Host.IndexOf("/", 0)
    54.             strFile = Host.Substring(pos)
    55.             Host = Host.Substring(0, pos)
    56.         Else
    57.             strFile = "/"
    58.         End If
    59.         If Method = "POST" Then
    60.             pos = strFile.IndexOf("?")
    61.             If Not (pos = -1) Then
    62.                 strPost = strFile.Substring(pos + 1)
    63.                 strFile = strFile.Substring(0, pos)
    64.             Else
    65.                 strPost = Nothing
    66.             End If
    67.         End If
    68.         LastPage = URL
    69.         Dim ReqHeaders As String = Nothing
    70.         If bGzip = True Then
    71.             If Method = "GET" OrElse Method = "PIC" Then
    72.                 ReqHeaders = "GET" + " " + strFile + " HTTP/1.1" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Host: " + Host + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Language: en-us,en;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Encoding: gzip, deflate" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Keep-Alive: 300" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: keep-alive" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Referer: " + Referer + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Cookie: " + strCookies + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & ""
    73.             Else
    74.                 ReqHeaders = "POST " + strFile + " HTTP/1.1" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Host: " + Host + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Language: en-us,en;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Encoding: gzip, deflate" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Keep-Alive: 300" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: keep-alive" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Referer: " + Referer + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Cookie: " + strCookies + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Type: application/x-www-form-urlencoded" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Length: " + strPost.Length.ToString + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: close" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + strPost
    75.             End If
    76.             If Method = "PIC" Then
    77.                 ReqHeaders.Replace("Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", "Accept: image/png,*/*;q=0.5")
    78.             End If
    79.         Else
    80.             If Method = "GET" OrElse Method = "PIC" Then
    81.                 ReqHeaders = "GET" + " " + strFile + " HTTP/1.1" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Host: " + Host + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Language: en-us,en;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" & "" + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Keep-Alive: 300" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: keep-alive" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Referer: " + Referer + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Cookie: " + strCookies + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & ""
    82.             Else
    83.                 ReqHeaders = "POST " + strFile + " HTTP/1.1" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Host: " + Host + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Language: en-us,en;q=0.5" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Keep-Alive: 300" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: keep-alive" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Referer: " + Referer + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Cookie: " + strCookies + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Type: application/x-www-form-urlencoded" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Content-Length: " + strPost.Length.ToString + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "Connection: close" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + "" & Microsoft.VisualBasic.Chr(13) & "" & Microsoft.VisualBasic.Chr(10) & "" + strPost
    84.             End If
    85.             If Method = "PIC" Then
    86.                 ReqHeaders.Replace("Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", "Accept: image/png,*/*;q=0.5")
    87.             End If
    88.         End If
    89.  
    90.         Dim tcp As New System.Net.Sockets.TcpClient
    91.         Dim netstream As System.Net.Sockets.NetworkStream
    92.         Dim TN(1) As Long
    93.         If Referer = "" Then Referer = LastPage
    94.         If InStr(1, URL, "http://") <> 0 Then Host = Mid$(URL, 8)
    95.         If InStr(1, Host, "/") <> 0 Then Host = Mid$(Host, 1, InStr(1, Host, "/") - 1)
    96.         If InStr(1, Host, "?") <> 0 Then Host = Mid$(Host, 1, InStr(1, Host, "?") - 1)
    97.         If Mid$(Host, 1, 4) = "www." Then Host = Mid$(Host, 5)
    98.         LastPage = URL
    99.         Try
    100.             tcp.Connect(Host, 80)
    101.         Catch ex As Exception
    102.             Return ex.Message
    103.         End Try
    104.  
    105.         Dim sendbytes As Byte()
    106.         sendbytes = System.Text.Encoding.ASCII.GetBytes(ReqHeaders)
    107.         netstream = tcp.GetStream()
    108.         netstream.Write(sendbytes, 0, sendbytes.Length)
    109.         Dim sr As StreamReader = New StreamReader(netstream, Encoding.Default)
    110.         Dim strHTML As String = sr.ReadToEnd
    111.         Dim strParts As String() = Regex.Split(strHTML, Environment.NewLine + Environment.NewLine)
    112.         strCookies = ParseCookies(strParts(0))
    113.         If strParts(0).Contains("Content-Encoding") Then
    114.             strParts(1) = DecompressGzip(strParts(1))
    115.         End If
    116.         Dim uppBound As Integer = strParts.GetUpperBound(0)
    117.         Dim strReturn As String = ""
    118.         For i As Integer = 1 To uppBound
    119.             strReturn += strParts(i)
    120.         Next
    121.         If InStr(strReturn, "aisha_signup.gif") Then
    122.             If frmMain.chkWarn.Checked = False Then
    123.                 frmMain.TimerAutobuy.Enabled = False
    124.                 frmMain.lblStatus.Text = "Logged out!"
    125.                 frmMain.GroupBox1.Enabled = True
    126.                 frmMain.cmdLogout.Enabled = False
    127.                 frmMain.cmdLogin.Enabled = True
    128.                 frmMain.cmdStop.Enabled = False
    129.                 frmMain.cmdStart.Enabled = True
    130.                 MsgBox("You have been logged out!", MsgBoxStyle.Critical, "Logged out!")
    131.                 ClearCookies()
    132.             Else
    133.                 frmMain.lblStatus.Text = "Logged out!"
    134.                 frmMain.TimerAutobuy.Enabled = False
    135.                 ClearCookies()
    136.                 Pause(5)
    137.                 frmMain.Login(frmMain.txtUsername.Text, frmMain.txtPassword.Text)
    138.                 Pause(5)
    139.                 frmMain.lblStatus.Text = "Looking for Items"
    140.                 frmMain.TimerAutobuy.Enabled = True
    141.                 frmMain.cmdStop.Enabled = True
    142.                 frmMain.cmdStart.Enabled = False
    143.             End If
    144.         End If
    145.         Return strReturn
    146.  
    147.  
    148.     End Function
    149.     Public Function DecompressGzip(ByVal compressed As String) As String
    150.         Dim memStream As MemoryStream = New MemoryStream(System.Text.Encoding.Default.GetBytes(compressed))
    151.         Dim decompressStream As GZipStream = New GZipStream(memStream, CompressionMode.Decompress)
    152.         Dim endBytes(4) As Byte
    153.         Dim position As Integer = CType(memStream.Length, Integer) - 4
    154.         memStream.Position = position
    155.         memStream.Read(endBytes, 0, 4)
    156.         memStream.Position = 0
    157.         Dim buffer(BitConverter.ToInt32(endBytes, 0) + 100) As Byte
    158.         Dim offset As Integer = 0
    159.         Dim total As Integer = 0
    160.         While True
    161.             Dim bytesRead As Integer = decompressStream.Read(buffer, offset, 100)
    162.             If bytesRead = 0 Then
    163.                 Exit While
    164.             End If
    165.             offset += bytesRead
    166.             total += bytesRead
    167.         End While
    168.         Return Encoding.ASCII.GetString(buffer)
    169.     End Function
    170.     Public Function ParseCookies(ByVal Headers As String) As String
    171.         ParseCookies = ""
    172.         Dim reg As Regex
    173.         Dim matches As MatchCollection
    174.         Dim match As Match
    175.         reg = New Regex("set-cookie:\s*([^=]+)=([^;]+);", RegexOptions.IgnoreCase)
    176.         If reg.IsMatch(Headers) Then
    177.             matches = reg.Matches(Headers)
    178.             For Each match In matches
    179.                 Try
    180.                     colCookies.Add(match.Groups(1).ToString & "=" & match.Groups(2).ToString, match.Groups(1).ToString)
    181.                 Catch ex As Exception
    182.                     colCookies.Remove(match.Groups(1).ToString)
    183.                     colCookies.Add(match.Groups(1).ToString & "=" & match.Groups(2).ToString, match.Groups(1).ToString)
    184.                 End Try
    185.             Next
    186.         End If
    187.         Dim i As Long
    188.         For i = 1 To colCookies.Count Step 1
    189.             ParseCookies = ParseCookies & colCookies.Item(i).ToString & ";"
    190.         Next
    191.     End Function
    192.     Public Function StripHeaders(ByVal strSource As String) As String
    193.         Dim strParts() As String = Regex.Split(strSource, Environment.NewLine + Environment.NewLine)
    194.         Return strParts(1)
    195.     End Function
    196.     Public Function NeoLogin(ByVal user As String, ByVal pass As String, ByRef loggedIn As Boolean) As String
    197.         ClearCookies()
    198.         Dim strHTML As String = Nothing
    199.         Request("GET", "http://neopets.com/loginpage.phtml", "http://google.com")
    200.         Pause(1)
    201.         Request("POST", "http://www.neopets.com/hi.phtml?destination=%2Fpetcentral.phtml&username=" + user, "http://neopets.com/loginpage.phtml")
    202.         Pause(1)
    203.         Request("POST", "http://www.neopets.com/login.phtml?username=" + user + "&password=" + pass + "&destination=%2Fpetcentral.phtml", "http://neopets.com/hi.phtml")
    204.         strHTML = Request("GET", "http://www.neopets.com/objects.phtml", "http://www.neopets.com/petcentral.phtml")
    205.         If strHTML.Contains("Welcome,") Then
    206.             loggedIn = True
    207.             Return "Logged In"
    208.         Else
    209.             If strHTML.Contains("too many times") Then
    210.                 loggedIn = False
    211.                 Return "To Many Login Attempts"
    212.             Else
    213.                 If strHTML.Contains("not logged in") Then
    214.                     loggedIn = False
    215.                     Return "Wrong Password"
    216.                 Else
    217.                     If strHTML.Contains("frozen") Then
    218.                         loggedIn = False
    219.                         Return "Account Frozen"
    220.                     Else
    221.                         If strHTML.Contains("just a technical problem") Then
    222.                             loggedIn = False
    223.                             Return "Neopets is down for maintenance."
    224.                         Else
    225.                             loggedIn = False
    226.                             Return strHTML
    227.                         End If
    228.                     End If
    229.                 End If
    230.             End If
    231.         End If
    232.     End Function
    233.     Private Shared Sub Pause(ByVal seconds As Double)
    234.         Dim num As Double = seconds * 1000
    235.         Dim t1 As DateTime = DateTime.Now
    236.         Dim t2 As DateTime = DateTime.Now
    237.         Dim tmDiff As TimeSpan = t2 - t1
    238.         While Convert.ToDouble(tmDiff.TotalMilliseconds.ToString) < num
    239.             t2 = DateTime.Now
    240.             tmDiff = t2 - t1
    241.             Application.DoEvents()
    242.         End While
    243.     End Sub
    244.     Public Function GrabPic(ByVal strURL As String) As System.Drawing.Image
    245.         Dim memStream As New MemoryStream(System.Text.Encoding.Default.GetBytes(StripHeaders(Request("GET", strURL, LastPage))))
    246.         GrabPic = Image.FromStream(memStream)
    247.         Return GrabPic
    248.     End Function
    249.     Public Function DownloadImage(ByVal URL As String) As System.Drawing.Image
    250.         Dim imageFile As New WebClient
    251.         Dim bytes() As Byte = imageFile.DownloadData(URL)
    252.  
    253.         Dim imageStream As New MemoryStream(bytes)
    254.         Dim downloadedImage As System.Drawing.Image = Image.FromStream(imageStream)
    255.  
    256.         DownloadImage = downloadedImage
    257.     End Function
    258.     Public Sub ClearCookies()
    259.         colCookies.Clear()
    260.         strCookies = Nothing
    261.     End Sub
    262.  
    263.     Public Function GetCookie()
    264.         Return strCookies
    265.     End Function
    266. End Class
    267.