用c#读文件
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://51xingfu.blog.51cto.com/219185/42286 |
using System; using System.IO; using System.Collections; class Anagrams { public static void Main(String[] args) { StreamReader din = File.OpenText ("words.txt"); String str; ArrayListst = new ArrayList(); 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(); } } 本文出自 “幸福开心豆” 博客,请务必保留此出处http://51xingfu.blog.51cto.com/219185/42286 本文出自 51CTO.COM技术博客 |



adai6666
博客统计信息
热门文章
最新评论
友情链接