F
fniles
I am using VB.NET 2005 and streamWriter to write to a file.
Before writing to the file, I encrypt the string.
StreamWriter does not write it correctly to the file, I have to change to
FileOpen, Print and FileClose to write it correctly to a file.
StreamWriter will write something like:
ÃzÃ,Ãz¬±°±¸²¬Ã,±°°²¬ÃSáòöéóüÂ
instead of
ÞÂÞ¬±°±¸²¬Â±°°²¬Êáòöéóü
Why does StreamWriter write it incorrectly ? Can I write those ascii
characters using StreamWriter ?
Thank you.
Dim swFile As StreamWriter
Crypt(Account1)
swFile = New streamWriter("c:\test.HTM", False)
swFile.Write(re)
swFile.Close()
Public Function Crypt(ByVal Text As String) As String
Dim strTempChar As String
Dim I As Int16
For I = 1 To Len(Text)
strTempChar = Asc(Mid$(Text, I, 1)) + {some number}
Mid$(Text, I, 1) = Chr(strTempChar)
Next I
Crypt = Text
Before writing to the file, I encrypt the string.
StreamWriter does not write it correctly to the file, I have to change to
FileOpen, Print and FileClose to write it correctly to a file.
StreamWriter will write something like:
ÃzÃ,Ãz¬±°±¸²¬Ã,±°°²¬ÃSáòöéóüÂ
instead of
ÞÂÞ¬±°±¸²¬Â±°°²¬Êáòöéóü
Why does StreamWriter write it incorrectly ? Can I write those ascii
characters using StreamWriter ?
Thank you.
Dim swFile As StreamWriter
Crypt(Account1)
swFile = New streamWriter("c:\test.HTM", False)
swFile.Write(re)
swFile.Close()
Public Function Crypt(ByVal Text As String) As String
Dim strTempChar As String
Dim I As Int16
For I = 1 To Len(Text)
strTempChar = Asc(Mid$(Text, I, 1)) + {some number}
Mid$(Text, I, 1) = Chr(strTempChar)
Next I
Crypt = Text