2011. 6. 17. 09:30
[VB6] 파일 쓰고 읽기 Enjoy/etc2011. 6. 17. 09:30
FileSystemObject
쓰기)
Public Sub Dir_WriteFile(ByVal File As String, ByVal Text As String)
Dim fso, FileWriter As Object
Set fso = CreateObject("scripting.FileSystemObject")
Set FileWriter = fso.CreateTextFile(File, True)
FileWriter.Write Text
FileWriter.Close
End Sub
읽기)
Function Dir_OpenFile(ByVal File As String) as string
Dim fso, FileWriter As Object
Set fso = CreateObject("scripting.FileSystemObject")
Set FileWriter = fso.OpenTextFile(File)
Dir_OpenFile = FileWriter.ReadAll
FileWriter.Close
End Function