Line endings are independent of encoding. If you want to convert the ending of Windows lines to the end of a Unix line, do this on the line itself:
myString = myString.Replace("\r\n", "\n");
Personally, I avoid using ASCII where possible, by the way - are you absolutely sure that he will never need any accented characters? If I get a choice, I usually use UTF-8:
myString = myString.Replace("\r\n", "\n");
byte[] bytes = Encoding.UTF8.GetBytes(myString);
- , StreamWriter File.CreateText .. , .