博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

文本的读和写

Posted on 2008-07-31 09:28  烈火123  阅读(119)  评论(0编辑  收藏  举报
  //写

                StreamWriter sw = File.AppendText("log_zd.htm");
                string jilu = "http://zhidao.baidu.com/question/" + counter + ".html
"; sw.WriteLine(jilu); sw.Close(); //读 StreamReader file = new StreamReader("c://标签.txt", Encoding.Default); //将文本放到数组中 string[] sz = new string[counter]; while ((line = file.ReadLine()) != null) { counter1++; sz[counter1 - 1] = line; //Console.WriteLine(line); }