html5中文学习网

您的位置: 首页 > 网络编程 > ASP.NET » 正文

用c#读文件_.NET教程_编程技术

[ ] 已经帮助:人解决问题
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();
    }
}

7tkHTML5中文学习网 - HTML5先行者学习网
7tkHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助