C#------IO练习

2021-09-29 20:14

阅读:875

标签: class Program { //练习一:将1.txt的文件字节与2.txt文件文件字节合并为一个文件3.txt。 static void Main(string[] args) { using( Stream fs1 = File.OpenRead(@"C:\Users\Administrator\Desktop\C#OOP练习\1.txt") ) using(Stream fs2 = File.OpenRead(@"C:\Users\Administrator\Desktop\C#OOP练习\2.txt") ) using (Stream OutStream = File.OpenWrite(@"C:\Users\Administrator\Desktop\C#OOP练习\3.txt")) { fs1.CopyTo(OutStream); fs2.CopyTo(OutStream); } } }  C#------IO练习标签:原文地址:http://www.cnblogs.com/phpweige/p/4777398.html


评论


亲,登录后才可以留言!