Posted 13 years ago
·
Author
'This code is used to empty the cookies from the user's computer / We call function from here.
Private Declare Function GetUserName _
Lib "advapi32.dll" Alias "GetUserNameW" ( _
ByVal lpBuffer As Long, _
ByRef nSize As Long) As Long
Private Declare Function SHGetSpecialFolderPath _
Lib "shell32.dll" Alias "SHGetSpecialFolderPathA" ( _
ByVal hwnd As Long, _
ByVal pszPath As String, _
ByVal csidl As Long, _
ByVal fCreate As Long) As Long
Private Const CSIDL_COOKIES As Long = &H21
'This calls the function that deletes the cookies.
Public Sub Command1_Click()
Dim sPath As String
sPath = Space(260)
Call SHGetSpecialFolderPath(0, sPath, CSIDL_COOKIES, False)
sPath = Left$(sPath, InStr(sPath, vbNullChar) - 1) & "\*.txt*"
On Error Resume Next
Kill sPath
End Sub
airbender wrote:yea i agree with you but atm thats all i can think of for a login i have a freidn that uses vb on a daily bases ill talk to him asap and see what he says
' Create a request using a URL that can receive a post.
Dim request As WebRequest = WebRequest.Create("https://secure.imvu.com/login/login/ ")
' Set the Method property of the request to POST.
request.Method = "POST"
' Create POST data and convert it to a byte array.
Dim postData As String = "sauce=&avatarname=uravi&password=urpass&password_strength=urpwstearh&sendto=&bcld=urbcld"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
' Set the ContentType property of the WebRequest.
request.ContentType = "application/x-www-form-urlencoded"
' Set the ContentLength property of the WebRequest.
request.ContentLength = byteArray.Length
' Get the request stream.
Dim dataStream As Stream = request.GetRequestStream()
' Write the data to the request stream.
dataStream.Write(byteArray, 0, byteArray.Length)
' Close the Stream object.
dataStream.Close()
' Get the response.
Dim response As WebResponse = request.GetResponse()
' Display the status.
Console.WriteLine(CType(response, HttpWebResponse).StatusDescription)
' Get the stream containing content returned by the server.
dataStream = response.GetResponseStream()
' Open the stream using a StreamReader for easy access.
Dim reader As New StreamReader(dataStream)
' Read the content.
Dim responseFromServer As String = reader.ReadToEnd()
' Display the content.
Console.WriteLine(responseFromServer)
' Clean up the streams.
reader.Close()
dataStream.Close()
response.Close()
End Sub
End Class
End Namespace
Dim extension As String = iconurl
extension = extension.Substring(extension.LastIndexOf(".") + 1).ToLower
Select Case extension
Case "bmp"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".bmp", System.Drawing.Imaging.ImageFormat.Bmp)
Case "jpg", "jpeg"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Case "gif"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".gif", System.Drawing.Imaging.ImageFormat.Gif)
Case "png"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".png", System.Drawing.Imaging.ImageFormat.Png)
Case "tif", "tiff"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".tiff", System.Drawing.Imaging.ImageFormat.Tiff)
End Select
airbender wrote:sweet also when i get my new rig setup ill be able to help you out more overe here in vb atm i only have a pos pc that wont run microsoft visual basics or anything like that for the matter but my new system will then i will be able to test the code i give you and help you write the login bit if your still stuck on it
Imports System.Text.RegularExpressions
Imports System.IO
Imports System.Text
Public Class Form1
Dim ithread As New System.Threading.Thread(AddressOf iDown)
Dim Url As String = ""
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CheckForIllegalCrossThreadCalls = False
Cnclbtn.Enabled = False
Rnbtn.Enabled = False
End Sub
Private Sub ExportUrlsToFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExportUrlsToFileToolStripMenuItem.Click
Dim myStream As Stream
Dim saveFileDialog1 As New SaveFileDialog()
saveFileDialog1.Filter = "txt files (*.txt)|*.txt"
saveFileDialog1.FilterIndex = 2
saveFileDialog1.RestoreDirectory = True
If saveFileDialog1.ShowDialog() = DialogResult.OK Then
myStream = saveFileDialog1.OpenFile
Using sw As StreamWriter = New StreamWriter(myStream)
sw.Write(iUrlbx.Text)
sw.Close()
End Using
If (myStream IsNot Nothing) Then
myStream.Close()
End If
End If
End Sub
Private Sub OpenImvuShopToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenImvuShopToolStripMenuItem.Click
Process.Start("http://www.imvu.com/shop/")
End Sub
Private Sub ResetToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResetToolStripMenuItem.Click
For Each ctrl As Control In ogb.Controls
If TypeOf ctrl Is TextBox Then
CType(ctrl, TextBox).Text = String.Empty
End If
If TypeOf ctrl Is ComboBox Then
CType(ctrl, ComboBox).SelectedIndex = 9
End If
Next ctrl
For Each ctrl As Control In ugb.Controls
If TypeOf ctrl Is RichTextBox Then
CType(ctrl, RichTextBox).Text = String.Empty
End If
Next ctrl
For Each ctrl As Control In igb.Controls
If TypeOf ctrl Is PictureBox Then
CType(ctrl, PictureBox).Image = Nothing
End If
Next ctrl
If Rnbtn.Enabled = False Then
Rnbtn.Enabled = True
End If
If Cnclbtn.Enabled = False Then
Cnclbtn.Enabled = True
End If
End Sub
Private Sub CategoryBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CategoryBox.SelectedIndexChanged
If CategoryBox.SelectedIndex = 0 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-128&page="
ElseIf CategoryBox.SelectedIndex = 1 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-78&page="
ElseIf CategoryBox.SelectedIndex = 2 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-75&page="
ElseIf CategoryBox.SelectedIndex = 3 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-89&page="
ElseIf CategoryBox.SelectedIndex = 4 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-90&page="
ElseIf CategoryBox.SelectedIndex = 5 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-76&page="
ElseIf CategoryBox.SelectedIndex = 6 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-101&page="
ElseIf CategoryBox.SelectedIndex = 7 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-153&page="
ElseIf CategoryBox.SelectedIndex = 8 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-324&page="
'''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''
ElseIf CategoryBox.SelectedIndex = 10 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-69&page="
ElseIf CategoryBox.SelectedIndex = 11 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-70&page="
ElseIf CategoryBox.SelectedIndex = 12 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-67&page="
ElseIf CategoryBox.SelectedIndex = 13 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-91&page="
ElseIf CategoryBox.SelectedIndex = 14 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-92&page="
ElseIf CategoryBox.SelectedIndex = 15 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-68&page="
ElseIf CategoryBox.SelectedIndex = 16 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-102&page="
ElseIf CategoryBox.SelectedIndex = 17 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-71&page="
ElseIf CategoryBox.SelectedIndex = 18 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-316&page="
'''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''
ElseIf CategoryBox.SelectedIndex = 22 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366&page="
ElseIf CategoryBox.SelectedIndex = 23 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-2102&page="
ElseIf CategoryBox.SelectedIndex = 24 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1787&page="
ElseIf CategoryBox.SelectedIndex = 25 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1030&page="
ElseIf CategoryBox.SelectedIndex = 26 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1907&page="
ElseIf CategoryBox.SelectedIndex = 27 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1564&page="
ElseIf CategoryBox.SelectedIndex = 28 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1980&page="
ElseIf CategoryBox.SelectedIndex = 29 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1901&page="
'''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''
ElseIf CategoryBox.SelectedIndex = 33 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027&page="
ElseIf CategoryBox.SelectedIndex = 34 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-909&page="
ElseIf CategoryBox.SelectedIndex = 35 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-1199&page="
ElseIf CategoryBox.SelectedIndex = 36 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-906&page="
ElseIf CategoryBox.SelectedIndex = 37 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-949&page="
ElseIf CategoryBox.SelectedIndex = 38 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-1332&page="
ElseIf CategoryBox.SelectedIndex = 39 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-917&page="
ElseIf CategoryBox.SelectedIndex = 40 Then
Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-950&page="
ElseIf CategoryBox.SelectedIndex = 43 Then
Url = InputBox("Enter Your Own Catalog Url", "")
End If
End Sub
Private Sub Rnbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rnbtn.Click
If Not ithread.IsAlive Then
ithread.Start()
End If
End Sub
Private Sub Cnclbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cnclbtn.Click
If ithread.IsAlive Then
ithread.Abort()
End If
End Sub
Sub iDown()
Dim i As Integer = 1
Dim fn As Integer = 1
If Not String.IsNullOrEmpty(plbox.Text) Then
Cnclbtn.Enabled = True
rnbtn.Enabled = False
If Not Directory.Exists(Environment.CurrentDirectory + "\Icons\") Then
Directory.CreateDirectory(Environment.CurrentDirectory + "\Icons\")
End If
If Not Url.Contains("&page=") Then
Url = String.Concat(Url, "&page=")
End If
Do Until i = plbox.Text + 1
Url = Url & i
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(Url)
Dim response As System.Net.HttpWebResponse = request.GetResponse
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim imvuicons As String = sr.ReadToEnd
Dim r As New System.Text.RegularExpressions.Regex("<img src=""http://userimages0.*-akm\.imvu\.com/productdata/.*"" class=""thumbnail"" alt="".*"" width=""100"" height=""80""/>", RegexOptions.IgnoreCase)
Dim matches As MatchCollection = r.Matches(imvuicons)
For Each icon As Match In matches
iUrlbx.AppendText(icon.Value.Split("""").GetValue(1) + vbNewLine)
Dim iconurl As String = icon.Value.Split("""").GetValue(1)
Iconbx.Image = New System.Drawing.Bitmap(New IO.MemoryStream(New System.Net.WebClient().DownloadData(iconurl)))
System.Threading.Thread.Sleep(100)
Dim extension As String = iconurl
Dim name As String = iconurl
name = name.Substring(name.LastIndexOf("/") + 1).ToLower
extension = extension.Substring(extension.LastIndexOf(".") + 1).ToLower
Select Case extension
Case "bmp"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Bmp)
Case "jpg", "jpeg"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Jpeg)
Case "gif"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Gif)
Case "png"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Png)
Case "tif", "tiff"
Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Tiff)
End Select
Next
i = i + 1
Loop
Cnclbtn.Enabled = False
Rnbtn.Enabled = True
Else
MsgBox("Please Enter A Valid Page Limit")
End If
End Sub
Private Sub iUrlbx_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles iUrlbx.TextChanged
Dim lineInfo As New StringBuilder()
lineInfo.Append(iUrlbx.Lines.Length.ToString())
If Not String.IsNullOrEmpty(iUrlbx.Text) Then
icount.Text = lineInfo.ToString() - 1
Else
icount.Text = "0"
End If
End Sub
Private Sub plbox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles plbox.TextChanged
If String.IsNullOrEmpty(plbox.Text) Then
Rnbtn.Enabled = False
Else
Rnbtn.Enabled = True
End If
End Sub
End Class