1. Code
1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.IO;4 usingSystem.Linq;5 usingSystem.Text;6 usingSystem.Threading.Tasks;7 8 namespaceConsoleApplication39 {Ten class Program One { A Static voidMain (string[] args) - { - stringstr =""Woe is greater than contentment, and guilt is greater than desire.""; the - using(FileStream fs=NewFileStream (@"1.txt", Filemode.create,fileaccess.write)) - { - byte[] buffer =Encoding.UTF8.GetBytes (str); +Fs. Write (Buffer,0, buffer. Length); - + } A atConsole.WriteLine ("Oumai Radium Carving Gaga"); - Console.readkey (); - } - } -}
0, buffer. Length);
This 0 is the meaning of the offset. When writing a file, 0 is right, but when not 0, I have not learned.
2. Effect
Console effects
I'm in the learning of podcasts. O (∩_∩) o~
TXT effect
C # Console Foundation FileStream writing string strings to a new TXT file