寫文件操作(VB)
来源:互联网 发布:java对象的创建过程 编辑:程序博客网 时间:2024/05/04 17:46
'写文件操作
Public Function WriteFile(strWhat As String, strFilePath As String, strFileName As String) As Boolean
WriteFile = False
Dim fso As New FileSystemObject
Dim fFile As File
Dim ts As TextStream
On Error GoTo ErrorHandl
Dim txtFile As String
Dim intFlag As Integer
txtFile = strFilePath & strFileName
intFlag = 8
If fso.FileExists(txtFile) = False Then
fso.CreateTextFile txtFile, True
intFlag = 2
End If
Set fFile = fso.GetFile(txtFile)
Set ts = fFile.OpenAsTextStream(intFlag, -2)
ts.WriteLine (strWhat)
ts.Close
WriteFile = True
Exit Function
ErrorHandl:
End Function
Public Function WriteFile(strWhat As String, strFilePath As String, strFileName As String) As Boolean
WriteFile = False
Dim fso As New FileSystemObject
Dim fFile As File
Dim ts As TextStream
On Error GoTo ErrorHandl
Dim txtFile As String
Dim intFlag As Integer
txtFile = strFilePath & strFileName
intFlag = 8
If fso.FileExists(txtFile) = False Then
fso.CreateTextFile txtFile, True
intFlag = 2
End If
Set fFile = fso.GetFile(txtFile)
Set ts = fFile.OpenAsTextStream(intFlag, -2)
ts.WriteLine (strWhat)
ts.Close
WriteFile = True
Exit Function
ErrorHandl:
End Function
- 寫文件操作(VB)
- VB中的文件操作
- vb操作EXCEL文件
- vb操作Excel文件
- vb 文件操作
- VB文件操作问题
- [VB.NET]文件操作
- vb控件操作文件
- VB.net文件操作
- VB操作文件实例
- VB中操作WORD文件
- 用VB操作INI文件
- VB如何操作INI文件
- VB中的文件操作文档
- VB常用文件操作类
- 用VB操作INI文件
- VB中INI文件操作
- VB.net ini文件操作
- a simple way ,to programing or writting!
- 查询前几条记录SQL在不同数据库中的用法
- 2006.4.22
- 2006.4.21
- Eclipse(3.1.2) and Laszlo IDE(laszloIDE-0.2.0-jdk1.5.zip)
- 寫文件操作(VB)
- Dreamweaver 也Vss
- Java开源项目Hibernate包作用详解
- 软件工程走火入魔
- 关于堆,栈的一些东西!
- 关于唱歌
- sqlca 与存储过程
- 常用SQL说明
- i love internet!