i've done an imageshack login and used webrequest
here's my code
Public Function im_login(ByVal pageUrl As String) As String
Dim response As System.Net.WebResponse = Nothing
Try
'' Setup our Web request
Dim request As System.Net.WebRequest = System.Net.WebRequest.Create(pageUrl)
'' Retrieve data from request
response = request.GetResponse()
Dim s As String
Dim streamReceive As System.IO.Stream = response.GetResponseStream()
Dim encoding As System.Text.Encoding = System.Text.Encoding.GetEncoding("utf-8")
Dim streamRead As System.IO.StreamReader = New System.IO.StreamReader(streamReceive, encoding)
im_cookie = New CookieContainer
If Not response.Headers.AllKeys.Contains("Set-Cookie") Then
MsgBox("Login error, please check your account details", MsgBoxStyle.ApplicationModal)
Invoke(inv2, Label2, "loginerr")
Return " "
Exit Function
End If
s = response.Headers.Item("Set-Cookie")
Dim cookie As New Cookie
cookie.Domain = ".imageshack.us"
cookie.Path = "/"
Dim temp As String = s.Substring(s.IndexOf("myid") + 5)
Dim id As String = temp.Substring(0, temp.IndexOf(";"))
cookie.Name = "myid"
cookie.Value = id
im_cookie.Add(cookie)
cookie = New Cookie
cookie.Domain = ".imageshack.us"
cookie.Path = "/"
temp = s.Substring(s.IndexOf("myimages") + 9)
myimages = temp.Substring(0, temp.IndexOf(";"))
cookie.Name = "myimages"
cookie.Value = myimages
im_cookie.Add(cookie)
cookie = New Cookie
cookie.Domain = ".imageshack.us"
cookie.Path = "/"
temp = s.Substring(s.IndexOf("isUSER") + 7)
Dim isuser As String = temp.Substring(0, temp.IndexOf(";"))
cookie.Name = "isUSER"
cookie.Value = isuser
im_cookie.Add(cookie)
'mycookie.Add(c)
Try
Dim temp1 As String = s.Substring(s.IndexOf("isUSER") + 7)
Dim us As String = temp1.Substring(0, temp1.IndexOf(";"))
Invoke(inv2, Label2, "info" + us)
Catch ex As Exception
End Try
Dim sr As String = streamRead.ReadToEnd()
If sr = "OK" Then
Invoke(inv2, Label2, "loggdin")
Else : Invoke(inv2, Label2, "loginerr")
MsgBox("There was an error, Please check your login details!", MsgBoxStyle.ApplicationModal)
End If
'' return the retrieved HTML
Return streamRead.ReadToEnd()
Catch ex As Exception
log("HttpPage: " + ex.Message)
Invoke(inv2, Label2, "loginerr")
MsgBox("Connection Problem : " & vbCrLf + ex.Message, MsgBoxStyle.ApplicationModal)
thread2.Abort()
Finally
''Check if exists, then close the response.
If Not response Is Nothing Then
response.Close()
End If
End Try
Return " "
End Function
now you have to examine the ritani login with firebug for example and get the post params used as well as the structure of the cookies that are set. www.getfirebug.com
Firecookie :: Add-ons for Firefox