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

📄 读出操作.frm

📁 Visual Basic 的一些典型例题的VB程序和结果
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "lt9-1"
   ClientHeight    =   2805
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5160
   LinkTopic       =   "Form1"
   ScaleHeight     =   2805
   ScaleWidth      =   5160
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox mytxt 
      Height          =   1935
      Left            =   360
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   240
      Width           =   4215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Click()
 
'方法1: 一行一行读出
    Dim InputData As String
    txtTest.Text = ""
    Open "c:\MYFILE.TXT" For Input As #1
    Do While Not EOF(1)
        Line Input #1, InputData
        txtTest.Text = txtTest.Text + InputData + vbCrLf  ' vbCrLf为表示回车换行符的系统常量
    Loop
    Close #1
    
    
    
    
'方法2:  一次性读出
'    txtTest.Text = ""
'    Open "c:\MYFILE.TXT" For Input As #1
'    txtTest.Text = Input(LOF(1), 1)
'    Close #1




'方法3: 一个个字符读
'    Dim InputData As String * 1
'    txtTest.Text = ""
'    Open "c:\MYFILE.TXT" For Input As #1
'    Do While Not EOF(1)
'        Input #1, InputData
'        txtTest.Text = txtTest.Text + InputData
'    Loop
'    Close #1

End Sub

⌨️ 快捷键说明

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