⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 导入淘宝ID,再导入店铺帐号,就可以实现自动收藏淘宝店铺!
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "BY IM Mamy"
   ClientHeight    =   10095
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   15000
   LinkTopic       =   "Form1"
   ScaleHeight     =   10095
   ScaleWidth      =   15000
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame3 
      Caption         =   "日志"
      Height          =   4095
      Left            =   -720
      TabIndex        =   13
      Top             =   8040
      Width           =   3615
      Begin VB.TextBox Text2 
         Height          =   3735
         Left            =   120
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   14
         Text            =   "Form1.frx":0000
         Top             =   240
         Width           =   3375
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "收藏"
      Height          =   4095
      Left            =   120
      TabIndex        =   7
      Top             =   960
      Width           =   3255
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   1080
         TabIndex        =   15
         Text            =   "标签"
         Top             =   240
         Width           =   2055
      End
      Begin VB.CommandButton Command2 
         Caption         =   "导入帐号"
         Height          =   375
         Left            =   2100
         TabIndex        =   10
         Top             =   2880
         Width           =   975
      End
      Begin VB.CommandButton Command1 
         Caption         =   "开始收藏"
         Enabled         =   0   'False
         Height          =   375
         Left            =   120
         TabIndex        =   8
         Top             =   720
         Width           =   1095
      End
      Begin MSComctlLib.ListView ListView1 
         Height          =   1575
         Left            =   120
         TabIndex        =   9
         Top             =   1200
         Width           =   2970
         _ExtentX        =   5239
         _ExtentY        =   2778
         View            =   3
         LabelEdit       =   1
         LabelWrap       =   -1  'True
         HideSelection   =   0   'False
         FullRowSelect   =   -1  'True
         GridLines       =   -1  'True
         _Version        =   393217
         ForeColor       =   -2147483640
         BackColor       =   -2147483624
         BorderStyle     =   1
         Appearance      =   1
         NumItems        =   2
         BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
            Text            =   "序号"
            Object.Width           =   972
         EndProperty
         BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
            SubItemIndex    =   1
            Text            =   "ID"
            Object.Width           =   4145
         EndProperty
      End
      Begin VB.Label Label4 
         Caption         =   "标签:"
         Height          =   255
         Left            =   360
         TabIndex        =   16
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Label2 
         Caption         =   "正在运行第"
         Height          =   255
         Left            =   120
         TabIndex        =   12
         Top             =   3720
         Width           =   2535
      End
      Begin VB.Label Label1 
         Caption         =   "Label1"
         Height          =   255
         Left            =   120
         TabIndex        =   11
         Top             =   3360
         Width           =   2655
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "配置"
      Height          =   735
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   2775
      Begin VB.CommandButton Command6 
         Caption         =   "加载配置"
         Default         =   -1  'True
         Height          =   375
         Left            =   5880
         TabIndex        =   6
         Top             =   240
         Width           =   975
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   1200
         TabIndex        =   4
         Text            =   "http://shop34875387.taobao.com/"
         Top             =   240
         Width           =   3015
      End
      Begin VB.OptionButton Option1 
         Caption         =   "旺铺"
         Height          =   255
         Left            =   4320
         TabIndex        =   3
         Top             =   360
         Value           =   -1  'True
         Width           =   735
      End
      Begin VB.OptionButton Option2 
         Caption         =   "普通"
         Height          =   255
         Left            =   5160
         TabIndex        =   2
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label3 
         Caption         =   "店铺地址:"
         Height          =   255
         Left            =   240
         TabIndex        =   5
         Top             =   360
         Width           =   855
      End
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   500
      Left            =   600
      Top             =   6240
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   480
      Top             =   7560
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin SHDocVwCtl.WebBrowser WebBrowser1 
      Height          =   9855
      Left            =   3480
      TabIndex        =   0
      Top             =   120
      Width           =   11415
      ExtentX         =   20135
      ExtentY         =   17383
      ViewMode        =   0
      Offline         =   0
      Silent          =   0
      RegisterAsBrowser=   0
      RegisterAsDropTarget=   1
      AutoArrange     =   0   'False
      NoClientEdge    =   0   'False
      AlignLeft       =   0   'False
      NoWebView       =   0   'False
      HideFileNames   =   0   'False
      SingleClick     =   0   'False
      SingleSelection =   0   'False
      NoFolders       =   0   'False
      Transparent     =   0   'False
      ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
      Location        =   "http:///"
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public iii As Integer
Public nnn As String
Public eee As String
Dim Pause As Boolean
Dim ul As String
Private WithEvents m_MyVar As HTMLInputElement
Attribute m_MyVar.VB_VarHelpID = -1


Private Sub Command1_Click()
If iii > ListView1.ListItems.Count Then MsgBox "查找完成": Exit Sub
Label2.Caption = "正在运行第 " & iii & " 个"
ListView1.ListItems(iii).Selected = True
ListView1.SelectedItem.EnsureVisible
If Pause = True Then Exit Sub
WebBrowser1.Navigate "http://member1.taobao.com/member/login.jhtml?ssl=false"
End Sub

Private Sub Command6_Click()
WebBrowser1.Navigate Text1.Text
End Sub

Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
    iii = Item.Text
    Command1_Click
End Sub
Private Sub Command2_Click()
On Error Resume Next
ListView1.ListItems.Clear
iii = 1
Dim data As String
Dim buffer As String
Dim TL As ListItem, k As Integer, j As Integer
Dim nub
j = 1
CommonDialog1.FileName = ""
CommonDialog1.Filter = "文本文件txt (*.txt)|*.txt"
CommonDialog1.ShowOpen
If CommonDialog1.FileName = "" Then Exit Sub

Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
    Line Input #1, buffer
    'nub = Split(buffer, "----")
      Set TL = ListView1.ListItems.Add(, , j)
                    TL.SubItems(1) = buffer
                    'TL.SubItems(2) = nub(1)
                    j = j + 1
Loop
Close #1
Label1.Caption = "共导入 " & ListView1.ListItems.Count & " 个帐号"
End Sub




Private Sub Form_Load()
iii = 1
nnn = x
eee = y
Label1.Caption = "共导入 0 个帐号"
Label2.Caption = "正在运行第 0 个"
WebBrowser1.Navigate "about:blank"
End Sub

Private Sub Text1_Change()
MsgBox "店铺名称改变,需要重新加载配置", vbOKOnly, "注意"
Command6.Enabled = True
Command1.Enabled = False
End Sub

Private Sub Timer1_Timer()
Timer1.Enabled = False
On Error GoTo Error1
    Set s = WebBrowser1.Document.getElementById("PopupFavorForm")
    Set bq = WebBrowser1.Document.getElementsByName("tags")
    s.Target = ""
    bq(0).Value = Text3.Text
    s.submit
Exit Sub
Error1:
  Set vDoc = WebBrowser1.Document
        For v = 0 To vDoc.All.length - 1 '检测所有标签
            If UCase(vDoc.All(v).tagName) = "SPAN" Then '找到input标签
                Set vTag = vDoc.All(v)
                Select Case vTag.className
                    Case "BookmarkCount"
                        sc = Trim(vTag.innerText)
                End Select
            End If
        Next
Text2.Text = Text2.Text & Time & ": 不能重复收藏----" & sc & vbCrLf
iii = iii + 1
Command1_Click
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If URL = "http://member1.taobao.com/member/login.jhtml?ssl=false" Then
        With ListView1
            If iii <= ListView1.ListItems.Count Then
                x = .ListItems(iii).SubItems(1)
                nnn = x
                s1 = Split(x, "----")
                x = s1(0)
                y = s1(1)
                Set a = WebBrowser1.Document.getElementsByName("TPL_username")
                Set b = WebBrowser1.Document.getElementsByName("TPL_password")
                Set d = WebBrowser1.Document.getElementsByName("Submit")
                a(0).Value = x
                b(0).Value = y
                d(0).Click
            Else
                MsgBox "查找完成"
            End If
        End With
End If
If URL = "http://member1.taobao.com/member/login.jhtml" Then
Dim err1
      Set vDoc = WebBrowser1.Document
        For v = 0 To vDoc.All.length - 1 '检测所有标签
            If UCase(vDoc.All(v).tagName) = "P" Then '找到input标签
                Set vTag = vDoc.All(v)
                Select Case vTag.className
                    Case "ErrorMsg"
                        err1 = Trim(vTag.innerText)
                End Select
            End If
        Next
    If err1 = "" Then
        WebBrowser1.Navigate "http://my.taobao.com/mytaobao/home/my_taobao.jhtml"
    Else
        MsgBox err1
        iii = iii + 1
        Command1_Click
    End If
End If
If URL = "http://favorite.taobao.com/popup/add_collect_success.htm" Then
      Set vDoc = WebBrowser1.Document
        For v = 0 To vDoc.All.length - 1 '检测所有标签
            If UCase(vDoc.All(v).tagName) = "SPAN" Then '找到input标签
                Set vTag = vDoc.All(v)
                Select Case vTag.className
                    Case "counter"
                        sc = Trim(vTag.innerText)
                End Select
            End If
        Next
Text2.Text = Text2.Text & Time & ": 收藏成功----" & sc & vbCrLf
iii = iii + 1
Command1_Click
End If
'---------------
If URL = ul Then
    Timer1.Enabled = True
End If
'---------------------
If URL = Trim(Text1.Text) Then
On Error GoTo ErrorHandler
'旺铺
    If Option1.Value = True Then
        Set f = WebBrowser1.Document.getElementById("xshop_collection_href")
        ul = "http://favorite.taobao.com/popup/add_collection.htm?" & Trim(f.getAttribute("mercury:params"))
    End If
'普通店铺
     If Option2.Value = True Then
        Set f = WebBrowser1.Document.getElementById("AddToFav")
        ul = "http://favorite.taobao.com/popup/add_collection.htm?" & Trim(f.getAttribute("mercury:params"))
'        Debug.Print ul
    End If
    MsgBox "加载成功!点开始按钮开始收藏!", vbOKOnly, "成功"
    Command6.Enabled = False
    Command1.Enabled = True
Exit Sub
ErrorHandler:
MsgBox "加载失败!店铺类型选择错误", vbOKOnly, "错误"
End If

If URL = "http://my.taobao.com/mytaobao/home/my_taobao.jhtml" Then
    WebBrowser1.Navigate "http://pro.taobao.com/mcd2009.htm"
End If

If URL = "http://pro.taobao.com/mcd2009.htm" Then
    WebBrowser1.Navigate "http://pro.taobao.com/mcd2009.htm?"
End If
End Sub
Private Sub WebBrowser1_DownloadBegin()
WebBrowser1.Silent = True
End Sub

Private Sub WebBrowser1_DownloadComplete()
WebBrowser1.Silent = True
End Sub
Private Function m_MyVar_onchange() As Boolean
MsgBox m_MyVar.Value
End Function

Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)

    Dim oWindow As HTMLWindow2
    Dim oDoc As HTMLDocument
    
    Set oDoc = pDisp.Document
    Set oWindow = oDoc.parentWindow
    
    Set m_MyVar = oDoc.createElement("input")
   m_MyVar.Type = "Hidden"
    m_MyVar.Id = "MyVar"
    'oDoc.appendChild m_MyVar
    'Debug.Print oDoc.body.innerHTML
    oDoc.getElementsByTagName("head").Item(0).appendChild m_MyVar
    'oDoc.body.appendChild (m_MyVar)
    oWindow.execScript "var oldalert=window.alert;window.alert=function myalert(msg){MyVar.value=msg;MyVar.fireEvent(""onchange"");};"
    
End Sub








⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -