VO FWrite->C# ReadAllText
Posted: Sun Oct 18, 2020 4:44 pm
In VO I write a crypted string like this:
ptrHandle := FCreate(cPath)
// ....some checks. creating + crypting the string
FWrite(ptrHandle, cText)
In C# I read it back as follows:
string cName = File.ReadAllText(cExeDir + "MyFile.txt", Encoding.ASCII);
(after which XSharp.VO.Functions.CryptRaw should decrypt it again, as suggested by Chris).
But the value in cName (before decrypting) doesn't look like the value I see written by the VO function.
What should I do to get the same result? In C# I tried some different encodings without success. I read the https://www.xsharp.eu/forum/public-prod ... se64#16183 thread
but I am not sure if I need to encode my string first in VO to get it back correctly in C#.
Finally I considered to use the X# function FRead but as this is part of XSharp.Core and not XSharp.VO I doubt if this is going to give me the same string back.
Dick
ptrHandle := FCreate(cPath)
// ....some checks. creating + crypting the string
FWrite(ptrHandle, cText)
In C# I read it back as follows:
string cName = File.ReadAllText(cExeDir + "MyFile.txt", Encoding.ASCII);
(after which XSharp.VO.Functions.CryptRaw should decrypt it again, as suggested by Chris).
But the value in cName (before decrypting) doesn't look like the value I see written by the VO function.
What should I do to get the same result? In C# I tried some different encodings without success. I read the https://www.xsharp.eu/forum/public-prod ... se64#16183 thread
but I am not sure if I need to encode my string first in VO to get it back correctly in C#.
Finally I considered to use the X# function FRead but as this is part of XSharp.Core and not XSharp.VO I doubt if this is going to give me the same string back.
Dick