| 格式化读取文本文件 |
|
| 作者:harsonli… 文章来源:第十空间 点击数: 本日:{$DayHits} 更新时间:2003-12-20 23:03:54 |
|
Function ReadtxtFile(strPathName As String) As String On Error GoTo Exit_Err Dim strFile As String
Open strPathName For Input As #1 ReadtxtFile = "" strFile = ""
Do While Not EOF(1) Line Input #1, strFile ' = Input(1, #1) if ReadtxtFile="" then ReadtxtFile = strFile else ReadtxtFile = ReadtxtFile & vbCrLf & strFile end if Loop Close #1
Exit Function Exit_Err: MsgBox Err.Description Exit Function End Function
调用方法: Private Sub 命令4_Click() Me.txt1 = ReadtxtFile("c:\file1.txt") End Sub
|
| 文章录入:tmtony 责任编辑:tmtony |
|
上一篇文章: 怎样使用Copyfile来复制文件
下一篇文章: 新增并将内容写入文本文件 |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |