菜鸟问题,C#中文件读写问题 用TextReader和TextWriter类实现,具体详见MSDN,例子多的很 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Stream s = new FileStream(@"\My Documents\" + Test1 + ".txt", FileMode.Open);Stream ss = new FileStream(@"\My Documents\" +" Test2" + ".txt", FileMode.Create);StreamReader sr = new StreamReader(s, Encoding.ASCII);string str = sr.ReadToEnd().ToString();byte[] b1 = System.Text.Encoding.ASCII.GetBytes(str);StreamWriter sw = new StreamWriter(ss,System.Text.Encoding.ASCII);sw.Write( b1);sw.Close();sr.Close();s.Close();我把Test1的内容,读出来,然后写到Test2里面,但是打开,显示的不是Test1的内容. 哈哈.知道了.参数不对.....把b1用System.Text.Encoding.ASCII.GetChars就转换下就OK拉~ 哈哈.知道了.参数不对.....把b1用System.Text.Encoding.ASCII.GetChars就转换下就OK拉~======别光顾着高兴啊,把帖子结了先 基于http的电信短信网关问题 从网络下载数据的疑问,高手指点! QueryTable填充数据的延迟 C#中,在textBoxt上如何禁用鼠標右鍵? 在线急等!(webform)水晶报表中插入‘园饼图表’可以设置标题字体大小,标签字体大小,怎样设置 -----------"标注线后字体 C#中,怎么使用同个方案不同项目的class 加班,郁闷!散分! C#中的类变量和对象有什么区别? 求解: OurMsg数据库登陆失败 我有一个c#问题 传参的问题,急哦!!!! 初学者急求如何用C#备份数据库文件
Stream ss = new FileStream(@"\My Documents\" +" Test2" + ".txt", FileMode.Create);StreamReader sr = new StreamReader(s, Encoding.ASCII);
string str = sr.ReadToEnd().ToString();
byte[] b1 = System.Text.Encoding.ASCII.GetBytes(str);StreamWriter sw = new StreamWriter(ss,System.Text.Encoding.ASCII);
sw.Write( b1);
sw.Close();
sr.Close();
s.Close();我把Test1的内容,读出来,然后写到Test2里面,但是打开,显示的不是Test1的内容.
======别光顾着高兴啊,把帖子结了先