文件处理问题 --在线等待
lhxtx 2003-03-13 09:57:34 Private Sub Form_Load()
log1.ShowOpen
Text1.Text = FileText(log1.filename)
End Sub
Function FileText(ByVal filename As String) As String
Dim handle As Integer
Dim ifile As String
' 判断文件存在性
On Error GoTo OpenErr
If Len(Dir$(filename)) = 0 Then
Err.Raise 53 '文件没有找到
End If
' 以binary模式打开文件
handle = FreeFile
Open filename$ For Binary As #handle
' 读取内容,关闭文件
FileText = Space$(LOF(handle))
Get #handle, , FileText
Close #handle
OpenErr:
End Function
打开一个txt文件后。怎么样把text1里的空格去掉呢?