Creating ANSI text files
I have a project where I create text-files. My project is configured to use UTF-8 encoding wich is why (i'm guessing) the text-files I create uses UTF-8 encoding.
How can I upon creating textfiles make sure it uses ANSI-encoding?
public static void Append(string message, string file)
if (!File.Exists(SOFilePath + GenDateTime + file))
FileStream fs = File.Create(SOFilePath + GenDateTime + file);
StreamWriter sw = File.AppendText(SOFilePath + GenDateTime + file);
catch (Exception exc)
check out this link
pay attention to "System.Text.UTF8Encoding" and the StreamWriter class, hope that helps
All right! That did point me in the right direction. Problem solved!
I have another issue regarding streaming textfiles. is there a way to stream several textfiles to a user? lets say a user clicks a button (ASP.NET) and after my app does it's thing a few diffrent textfiles displays to the user.
My cuurent solution is that the app saves textfiles to a folder on the client-harddrive. Wich I would like to avoid.
Originally Posted by Zcumbag
sorry, I'm not sure if I understand your question, would you please explain more in detail?
Also if you don't mind, may I suggest you open a new question with a new thread? It'll be easier for reading to read and search (i.e. google).
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)