日期:2009-07-22  浏览次数:20339 次

<%@ Page Language="C#" Debug="true" %>

<%@ Import Namespace="System.IO" %>
<script language="C#" runat="server">
protected void Page_Load(Object Src, EventArgs E){
string str;

StringTable st = new StringTable();
StreamReader din = new StreamReader("c:\\test.txt",Encoding.Default);
/*构建StreamReader时,可以附带第二个函数,即其编码,默认情况下会用UTF-8打开。另外,兄弟,不要脱了裤子放屁浪费一个手续,StreamReader本身就可以
打开文件的(It's only a joke)*/
while ((str=din.ReadLine()) != null) {
st.Add(str);
}
foreach (string ss in st)
{
Response.Write (ss);
}
}
</script>