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

📄 form1.frm

📁 实现Web文件检索的小程序
💻 FRM
字号:
VERSION 5.00
Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
Begin VB.Form Form1 
   Caption         =   "Web文件检索"
   ClientHeight    =   2565
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4170
   LinkTopic       =   "Form1"
   ScaleHeight     =   2565
   ScaleWidth      =   4170
   StartUpPosition =   1  '所有者中心
   Begin InetCtlsObjects.Inet Inet1 
      Left            =   3825
      Top             =   1725
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   375
      Left            =   2790
      TabIndex        =   3
      Top             =   2130
      Width           =   1320
   End
   Begin VB.CommandButton Command1 
      Caption         =   "清空数据"
      Height          =   375
      Left            =   1410
      TabIndex        =   2
      Top             =   2130
      Width           =   1320
   End
   Begin VB.ListBox List1 
      Height          =   1500
      Left            =   30
      TabIndex        =   1
      Top             =   540
      Width           =   4050
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   30
      TabIndex        =   0
      Text            =   "ftp://www.mingrisoft.com"
      Top             =   75
      Width           =   4035
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim ending As Boolean
Dim comd As String

Private Sub Inet1_StateChanged(ByVal State As Integer)  '判断Internet连接状态
  Dim directory As String
  Dim position, newposition As Long
  If State = icResponseCompleted Then  '与主机连接成功
     Select Case comd
     Case "dir"
       position = -1
       directory = Inet1.GetChunk(0)
       List1.AddItem ("..")
       Do
         newposition = InStr(position + 2, directory, vbCr + vbLf, 1)
         If newposition = Len(directory) - 1 Then Exit Sub
         List1.AddItem Mid(directory, position + 2, newposition - (position + 2))
         position = newposition
       Loop
     End Select
     ending = True
  End If
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer) '输入往址
  If KeyAscii = vbKeyReturn Then
     comd = "dir"
     Inet1.Execute Text1.Text, "dir"
  End If
End Sub
Private Sub Command1_Click()  ' 清空数据
  List1.Clear
End Sub

Private Sub Command2_Click()
  End
End Sub

⌨️ 快捷键说明

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