专注.NET技术及其相关应用开发!

给我一个机会,还你一个惊喜!用这个机会创造出更多的价值!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
if(File.Exists(path))
{
   StreamReader din = File.OpenText(path);
   while ((str=din.ReadLine()) != null) 
   {
   byte[] ansiBytes = ansi.GetBytes(str);
   byte[] unicodeBytes = Encoding.Convert(ansi,unicode,ansiBytes);
   str = unicode.GetString(unicodeBytes);
   str = str + "\r\n";
   TextBox1.Text = TextBox1.Text + str;
   }
   din.Close();
}
else
{
   Msg.Text = "没有需要录入的文本文件。";
}
posted on 2005-09-25 10:11  婕舞飞扬  阅读(998)  评论(0编辑  收藏  举报