使用StreamReader读取 一个文本文件,为什么中文全是乱码?????????????????
yxfs 2004-06-26 06:21:43 <%@ Page language="c#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<script language="c#" runat=server >
string str1;
</script>
<title>
file
</title>
<%
StreamReader sr = new StreamReader("c:\\1.txt") ;
String line;
// Read and display lines from the file until the end of
// the file is reached.
while ((line = sr.ReadLine()) != null)
{
Response.Write(line);
}
%>
上面的代码是使用StreamReader读取 一个文本文件,为什么中文全是乱码????
英文没有乱码!!
急!!!!!!!!