|
-
Jul 26th, 2005, 04:51 PM
#1
Thread Starter
New Member
writing to a txt file, then opening and reading
hi, below is some code i'm using, everything works and "MsgBox base64Str" prompts the correct value, but instead of MsgBox, i'm trying to create a text file, write the values of base64Str to the file, then open it for reading, this is what i have so far (after the MsgBox base64Str)
thanks:
VB Code:
' Base64 ActiveX creation:
set obj = CreateObject("Base64.Base64")
' Load a GIF image file into memory.
binaryData = obj.LoadBinaryFile("Prem.gif")
' Convert the binary data to a base64 string
base64Str = obj.ToBase64(binaryData)
' Display the base-64 string.
MsgBox base64Str
Dim oFile as System.IO.File
Dim oWrite as System.IO.StreamWriter
oWrite = oFile.CreateText(“C:\basecoder64\test.txt”)
oWrite.WriteLine(base64Str)
ooWrite.Close()
Dim EntireFile as String
oRead = oFile.OpenText(“C:\basecoder64\test.txt”)
EntireFile = oRead.ReadToEnd()
OpenText
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|