如果要写到外部文件中,那么你可以自己定义它的文件格式。二进制文件也好,文本格式也好,都可以满足你的要求的。你可以使用kernel32.dll中提供的api函数CreateFile,ReadFile,WriteFile来完成对文件的操作。具体的:
Declare Function WriteFile Lib "kernel32" _
(ByVal hFile As Long, _
ByVal lpBuffer As Any, _
ByVal nNumberOfBytesToWrite As Long, _
lpNumberOfBytesWritten As Long, _
lpOverlapped As Any) As Long
Declare Function ReadFile Lib "kernel32" _
(ByVal hFile As Long, _
lpBuffer As Any, _
ByVal nNumberOfBytesToRead As Long, _
lpNumberOfBytesRead As Long, _
lpOverlapped As Any) As Long
Declare Function CreateFile Lib "kernel32" _
(ByVal lpFileName as String,_
ByVal dwDesiredAccess as Long,_
ByVal dwShareMode as Long,_
ByVal lpSecurityAttributes as Any,_
ByVal dwCreationDisposition as Long,_
ByVal dwFlagsAndAttributes as Long,_
ByVal hTemplateFile as Long
) As Long