📄 ftpp.frm
字号:
VERSION 5.00
Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5535
ClientLeft = 60
ClientTop = 450
ClientWidth = 7200
LinkTopic = "Form1"
ScaleHeight = 5535
ScaleWidth = 7200
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text2
Height = 2535
Left = 3720
TabIndex = 3
Text = "Text2"
Top = 1200
Width = 2895
End
Begin VB.TextBox Text1
Height = 2535
Left = 480
TabIndex = 2
Text = "Text1"
Top = 1200
Width = 2895
End
Begin VB.CommandButton Command2
Caption = "Command2"
Height = 375
Left = 3360
TabIndex = 1
Top = 4440
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 375
Left = 960
TabIndex = 0
Top = 4440
Width = 1335
End
Begin InetCtlsObjects.Inet Inet1
Left = 480
Top = 240
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
Protocol = 2
RemotePort = 21
URL = "ftp://"
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim a As String
Dim str As String
Dim RetCode As Long
Inet1.OpenURL "http://localhost/xml/tt.htm"
If Inet1.StillExecuting Then
DoEvents
End If
MsgBox Inet1.GetHeader
str = Inet1.GetHeader("Last-modified")
str = Replace(Right(str, Len(str) - InStr(1, str, ",") - 1), "GMT", "")
Text1.Text = CDate(Format(str, "yyyy/mm/dd hh:mm:ss"))
MsgBox Inet1.GetHeader("content-length")
RetCode = Val(Mid(Trim(Inet1.GetHeader), 10, 3))
Select Case RetCode
Case 200
MsgBox "成功"
Case 404
MsgBox "没有发现"
Case Else
MsgBox "Error"
End Select
End Sub
Private Sub Command2_Click()
Inet1.Cancel
If Len(Inet1.OpenURL("http://localhost/xml\tt.htm")) <> 0 Then
MsgBox "已经连接"
Text2.Text = Inet1.OpenURL("http://localhost/xml\tt.htm")
If Inet1.StillExecuting Then
DoEvents
End If
'保存到文件
Open App.Path & "\index.htm" For Output As #1
Print #1, Text2.Text
Close #1
Else
MsgBox "没有连接"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -