首 页 | 报价 | 活动 | 硬件 | 数码 | 整机 | 手机 | 新闻 | DIY | 导购 | 学院 | 专题 | 市场地图 | 商家名录 | 商情 | 论坛 | 下载 | 电视 | 算命 | 读心术 | 游戏
您现在的位置: 首页>学院>开发平台>VC/C#>正文
用c#读文件
文章来源: 文章作者: 发布时间:2006-03-28



  using System;
using System.IO;
using System.Collections;

class Anagrams
{

public static void Main(String[] args)
{
StreamReader din = File.OpenText ("words.txt");
String str;
StringTable st = new StringTable();

Console.WriteLine("Reading data and insterting into a StringTable.");
while ((str=din.ReadLine()) != null) {
st.Add(str);
}
Console.WriteLine("Printing out the StringTable.");
foreach (string s in st)
{
Console.WriteLine (s);
}

Console.WriteLine ("\r\nPress Return to exit.");
Console.Read();
}
}


上一篇:用C#代码动态改变页面样式
下一篇:用C#访问Hotmail
精彩推荐     
关于我们 | 广告服务 | 建站服务 | 招贤纳士 | 会员服务 | 网站地图 | RSS订阅 | 联系我们

实名:中原硅谷网、电脑报价、电脑硬件报价 客服电话:0371-63659150

中原硅谷网 WWW.ZZIT.COM.CN&WWW.ZZ-IT.COM
2003-2007 版权所有