>But for a jpg you shouldn't do a conversion. IOW remove conversion from code. Just write it out with BinaryWriter (might do with text as well).
>PS:UnicodeEncoding was sample and you might use other encodings' GetString() method too. Unicode is 2 bytes per character.
Well, the goal of FileToStr() is to have a universal function that can send me the string equivalent of all kind of files. So, basically, if I do FileToStr("d:\Text.txt") or FileToStr("d:\Logo.jpg"), I need to have the string equivalent. This is why I ended up with FileToStr() and FileToStrBinary() in my framework.
As for VFP's FileToStr(), I read on West Wind board that this function cannot handle binary files and someone else over there ended up in the same situation as me, but from VFP that time. IAC, I did two methods to achieve the same. So, it seems VFP's FileToStr(), based from what I read, cannot accomplish that from one function as it can only work with text files.
However, if you can know how to accomplish a .NET FileToStr() method that would handle all kind of files, that would be appreciated.