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

📄 http.frm

📁 Visual Basic 6 大学教程的代码
💻 FRM
字号:
VERSION 5.00
Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
Begin VB.Form frmHTTP 
   Caption         =   "Get URL Text"
   ClientHeight    =   3210
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3210
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin InetCtlsObjects.Inet Inet1 
      Left            =   3720
      Top             =   480
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      URL             =   "http://"
   End
   Begin VB.CommandButton cmdGo 
      Caption         =   "Go Get URL"
      Height          =   375
      Left            =   120
      TabIndex        =   3
      Top             =   480
      Width           =   1215
   End
   Begin VB.TextBox txtOutput 
      Height          =   2175
      Left            =   0
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   2
      Top             =   1000
      Width           =   4695
   End
   Begin VB.TextBox txtURL 
      Height          =   285
      Left            =   600
      TabIndex        =   1
      Top             =   105
      Width           =   3975
   End
   Begin VB.Label lblURL 
      Caption         =   "URL:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   135
      Width           =   375
   End
End
Attribute VB_Name = "frmHTTP"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 19.5
' Using the Internet Transfer Control to download the contents
' of a file over an HTTP connection.
Option Explicit

Private Sub cmdGo_Click()
   ' if txtURL is not empty, go to URL specified in txtURL
   On Error Resume Next
   
   If txtURL.Text <> "" Then
      txtOutput.Text = "Retrieving file ..."
      txtOutput.Text = Inet1.OpenURL(txtURL.Text)
   End If
End Sub

Private Sub Form_Resize()
   ' set dimensions of txtURL and WebBrowser1
   On Error Resume Next
   txtOutput.Width = ScaleWidth
   txtOutput.Height = ScaleHeight - txtOutput.Top
   txtURL.Width = ScaleWidth - txtURL.Left
End Sub

⌨️ 快捷键说明

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