<script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>
近期在学习C#,在用到StreamWriter输出中文到文件发现了一些乱码的问题.
解决如下
将一般的:
outFile = new StreamWriter ("c://abc.txt",false);
该成
outFile = new StreamWriter ("c://abc.txt",false,Encoding.GetEncoding("gb2312"));
outFile.WriteLine("中文");
输出中文就没问题了;