update src...

Signed-off-by: j502647092 <jtb1@163.com>
master
j502647092 2015-06-08 20:06:30 +08:00
parent ae0a8eead4
commit 84aeb31b5b
4 changed files with 169 additions and 185 deletions

View File

@ -5,107 +5,86 @@ Begin VB.Form Frm_Main
ClientHeight = 9390 ClientHeight = 9390
ClientLeft = 120 ClientLeft = 120
ClientTop = 450 ClientTop = 450
ClientWidth = 15750 ClientWidth = 17160
LinkTopic = "Form1" LinkTopic = "Form1"
ScaleHeight = 9390 ScaleHeight = 9390
ScaleWidth = 15750 ScaleWidth = 17160
StartUpPosition = 3 '窗口缺省 StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton getitem Begin VB.TextBox urlT
Caption = "Item" Height = 270
Height = 375 Index = 3
Left = 10440
TabIndex = 12
Top = 720
Width = 1215
End
Begin VB.CommandButton getmain
Caption = "Main"
Height = 375
Left = 9000
TabIndex = 11
Top = 720
Width = 1215
End
Begin VB.TextBox mainurl
Height = 300
Left = 1125
TabIndex = 9
Text = "I:\工作空间\VB工程文件\Git工程文件\首图导出工具\fp.html"
Top = 90
Width = 7575
End
Begin VB.TextBox itemurl
Height = 300
Left = 8760 Left = 8760
TabIndex = 8 TabIndex = 13
Text = "I:\工作空间\VB工程文件\Git工程文件\首图导出工具\fp.html" Text = "Text1"
Top = 90 Top = 405
Width = 6975 Width = 7710
End End
Begin SHDocVwCtl.WebBrowser item Begin VB.TextBox urlT
Height = 7650 Height = 270
Left = 8175 Index = 2
TabIndex = 7 Left = 945
Top = 1695 TabIndex = 12
Width = 7530 Text = "Text1"
ExtentX = 13282 Top = 405
ExtentY = 13494 Width = 7710
ViewMode = 0 End
Offline = 0 Begin VB.TextBox urlT
Silent = 0 Height = 270
RegisterAsBrowser= 0 Index = 1
RegisterAsDropTarget= 1 Left = 8760
AutoArrange = 0 'False TabIndex = 10
NoClientEdge = 0 'False Text = "Text1"
AlignLeft = 0 'False Top = 105
NoWebView = 0 'False Width = 7710
HideFileNames = 0 'False End
SingleClick = 0 'False Begin VB.TextBox urlT
SingleSelection = 0 'False Height = 270
NoFolders = 0 'False Index = 0
Transparent = 0 'False Left = 945
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}" TabIndex = 9
Location = "http:///" Text = "Text1"
Top = 105
Width = 7710
End
Begin 导出商品首图.TzDownload dl
Height = 195
Index = 0
Left = 30
Top = 1185
Width = 17070
_ExtentX = 30110
_ExtentY = 344
End End
Begin VB.TextBox folder Begin VB.TextBox folder
Height = 300 Height = 300
Left = 1125 Left = 13500
TabIndex = 5 TabIndex = 6
Text = "首图" Top = 840
Top = 990 Width = 3495
Width = 7575
End
Begin 导出商品首图.TzDownload dl
Height = 240
Left = 120
Top = 1395
Width = 15555
_ExtentX = 27437
_ExtentY = 423
ForeColor = 33023
End
Begin VB.TextBox itempicurl
Height = 300
Left = 1125
TabIndex = 4
Top = 690
Width = 7575
End End
Begin VB.TextBox itemname Begin VB.TextBox itemname
Height = 300 Height = 300
Left = 1125 Left = 945
TabIndex = 3 TabIndex = 4
Top = 390 Top = 840
Width = 7575 Width = 3345
End End
Begin SHDocVwCtl.WebBrowser main Begin VB.TextBox itempicurl
Height = 7995 Height = 300
Left = 5190
TabIndex = 2
Top = 840
Width = 7230
End
Begin SHDocVwCtl.WebBrowser web
Height = 7665
Index = 0
Left = 45 Left = 45
TabIndex = 10 TabIndex = 3
Top = 1695 Top = 1695
Width = 8085 Width = 8535
ExtentX = 14261 ExtentX = 15055
ExtentY = 14102 ExtentY = 13520
ViewMode = 0 ViewMode = 0
Offline = 0 Offline = 0
Silent = 0 Silent = 0
@ -123,36 +102,80 @@ Begin VB.Form Frm_Main
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}" ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
Location = "http:///" Location = "http:///"
End End
Begin SHDocVwCtl.WebBrowser web
Height = 7665
Index = 1
Left = 8625
TabIndex = 8
Top = 1695
Width = 8490
ExtentX = 14975
ExtentY = 13520
ViewMode = 0
Offline = 0
Silent = 0
RegisterAsBrowser= 1
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
Begin 导出商品首图.TzDownload dl
Height = 195
Index = 1
Left = 30
Top = 1440
Width = 17070
_ExtentX = 30110
_ExtentY = 344
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "网页链接:"
Height = 180
Left = 120
TabIndex = 11
Top = 450
Width = 810
End
Begin VB.Label Label4 Begin VB.Label Label4
AutoSize = -1 'True AutoSize = -1 'True
Caption = "文件夹名称:" Caption = "文件夹名称:"
Height = 180 Height = 180
Left = 120 Left = 12465
TabIndex = 6 TabIndex = 7
Top = 1080 Top = 900
Width = 990 Width = 990
End End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "首图链接:"
Height = 180
Left = 120
TabIndex = 2
Top = 765
Width = 810
End
Begin VB.Label Label2 Begin VB.Label Label2
AutoSize = -1 'True AutoSize = -1 'True
Caption = "商品名称:" Caption = "商品名称:"
Height = 180 Height = 180
Left = 120 Left = 120
TabIndex = 5
Top = 900
Width = 810
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "首图链接:"
Height = 180
Left = 4365
TabIndex = 1 TabIndex = 1
Top = 465 Top = 900
Width = 810 Width = 810
End End
Begin VB.Label Label1 Begin VB.Label Label1
AutoSize = -1 'True AutoSize = -1 'True
Caption = "商品链接:" Caption = "网页链接:"
Height = 180 Height = 180
Left = 120 Left = 120
TabIndex = 0 TabIndex = 0
@ -167,111 +190,45 @@ Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False Attribute VB_Exposed = False
Option Explicit Option Explicit
Dim strUrl As String Dim strUrl As String
Private Sub dl_OnFinished(ByVal Result As Boolean)
If Result Then
Else
End If
End Sub
Private Sub goto_Click()
main.Navigate2 mainurl.Text
End Sub
Private Sub Form_Load() Private Sub Form_Load()
main.Navigate2 "http://192.168.0.8:83/" web(0).Navigate2 "http://192.168.0.8:83/"
End Sub End Sub
Private Sub Form_Resize() Private Sub Form_Resize()
On Error Resume Next On Error Resume Next
main.Width = Me.Width - 50 web(0).Width = Me.Width - 50
item.Width = Me.Width - 50 web(1).Width = Me.Width - 50
Dim lefthg Dim lefthg
lefthg = Me.Height - main.Top lefthg = Me.Height - web(0).Top
main.Height = lefthg / 2 - 350 web(0).Height = lefthg / 2 - 350
item.Height = lefthg / 2 - 350 web(1).Height = lefthg / 2 - 350
main.Top = 1700 web(0).Top = 1700
item.Top = 1700 + main.Height + 20 web(1).Top = 1700 + web(0).Height + 20
main.Left = 10 web(0).Left = 10
item.Left = 10 web(1).Left = 10
dl.Left = 10 dl(0).Left = 10
dl.Width = Me.Width - 20 dl(0).Width = Me.Width - 20
dl(1).Left = 10
dl(1).Width = Me.Width - 20
End Sub End Sub
Private Sub getmain_Click() Private Sub getfp(webb As WebBrowser)
Call getfp(main)
End Sub
Private Sub getitem_Click()
Call getfp(item)
End Sub
Private Sub getfp(web As WebBrowser)
On Error Resume Next On Error Resume Next
Dim i, j, vDoc Dim i, j, vDoc
Set vDoc = web.Document Set vDoc = webb.Document
itemname = resetfilename(vDoc.getelementsbytagname("input")("subject").Value) itemname = resetfilename(vDoc.getelementsbytagname("input")("subject").Value)
itempicurl = vDoc.getelementsbytagname("input")("pictureUrl")(0).Value itempicurl = vDoc.getelementsbytagname("input")("pictureUrl")(0).Value
If folder = "" Then folder = InputBox("请输入 日期-首图-公司名称-提单人名称!", , "日期-首图-公司名称-提单人名称")
dl.FileDownload itempicurl, App.Path & "\" & folder & "\" & itemname & ".jpg" dl.FileDownload itempicurl, App.Path & "\" & folder & "\" & itemname & ".jpg"
End Sub End Sub
Private Sub item_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If InStr(1, URL, "operator=edit") Then Call getfp(item)
End Sub
Private Sub main_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If InStr(1, URL, "operator=edit") Then Call getfp(main)
End Sub
Private Sub item_NewWindow2(ppDisp As Object, Cancel As Boolean)
Set ppDisp = main.Object
End Sub
Private Sub main_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
If URL <> "http:///" And URL <> "" And URL <> "about:blank" Then mainurl = URL
End Sub
Private Sub item_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
If URL <> "http:///" And URL <> "" And URL <> "about:blank" Then itemurl = URL
End Sub
Private Sub main_NewWindow2(ppDisp As Object, Cancel As Boolean)
Set ppDisp = item.Object
'Cancel = True
'item.Navigate strUrl
End Sub
Private Sub main_DownloadBegin()
main.Silent = True
End Sub
Private Sub main_DownloadComplete()
main.Silent = True
End Sub
Private Sub item_DownloadBegin()
item.Silent = True
End Sub
Private Sub item_DownloadComplete()
item.Silent = True
End Sub
Private Sub itemurl_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then item.Navigate2 itemurl.Text
End Sub
Private Sub mainurl_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then main.Navigate2 mainurl.Text
End Sub
Private Function resetfilename(ByVal name As String) As String Private Function resetfilename(ByVal name As String) As String
name = clear(name, "/") name = clear(name, "/")
name = clear(name, "\") name = clear(name, "\")
@ -286,3 +243,29 @@ Private Function clear(name As String, p As String) As String
clear = Replace(name, p, "") clear = Replace(name, p, "")
End Function End Function
Private Sub urlT_KeyPress(index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then web(index).Navigate2 urlT(index).Text
End Sub
Private Sub web_BeforeNavigate2(index As Integer, ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
If URL <> "http:///" And URL <> "" And URL <> "about:blank" Then urlT(index) = URL
End Sub
Private Sub web_DocumentComplete(index As Integer, ByVal pDisp As Object, URL As Variant)
If InStr(1, URL, "operator=edit") Then Call getfp(web(index))
End Sub
Private Sub web_DownloadBegin(index As Integer)
web(index).Silent = True
End Sub
Private Sub web_DownloadComplete(index As Integer)
web(index).Silent = True
End Sub
Private Sub web_NewWindow2(index As Integer, ppDisp As Object, Cancel As Boolean)
Dim i
For i = 1 To web.UBound
If Not web(index).Busy Then Set ppDisp = web(1): Cancel = True
Next
End Sub

BIN
首图导出工具.exe Normal file

Binary file not shown.

View File

@ -6,6 +6,7 @@ Form=Frm_Main.frm
UserControl=..\VB用户控件\TzDownload.ctl UserControl=..\VB用户控件\TzDownload.ctl
Startup="Frm_Main" Startup="Frm_Main"
HelpFile="" HelpFile=""
ExeName32="首图导出工具.exe"
Command32="" Command32=""
Name="导出商品首图" Name="导出商品首图"
HelpContextID="0" HelpContextID="0"

View File

@ -1,2 +1,2 @@
Frm_Main = 422, 3, 1308, 452, , 50, 50, 1161, 739, C Frm_Main = 11, 158, 897, 607, Z, 50, 50, 1161, 739, C
TzDownload = 25, 25, 911, 474, C, 75, 75, 961, 524, C TzDownload = 25, 25, 911, 474, C, 75, 75, 961, 524, C