|
技术资料 > .Net专区 > Asp.Net开发 : 开心就贴(二) |
开心就贴(二) March 25,2004 |
<%@ 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>
|
|
Copyright © 2001-2008 Shenzhen Hiblue Software Team All rights reserved