用TextReader和TextWriter类实现,具体详见MSDN,例子多的很

解决方案 »

  1.   

    Stream s = new FileStream(@"\My Documents\" + Test1 + ".txt", FileMode.Open);
    Stream ss = new FileStream(@"\My Documents\" +" Test2" + ".txt", FileMode.Create);StreamReader sr = new StreamReader(s, Encoding.ASCII);
    string str = sr.ReadToEnd().ToString();
    byte[] b1 = System.Text.Encoding.ASCII.GetBytes(str);StreamWriter sw = new StreamWriter(ss,System.Text.Encoding.ASCII);
    sw.Write( b1);
    sw.Close();
    sr.Close();
    s.Close();我把Test1的内容,读出来,然后写到Test2里面,但是打开,显示的不是Test1的内容.
      

  2.   

    哈哈.知道了.参数不对.....把b1用System.Text.Encoding.ASCII.GetChars就转换下就OK拉~
      

  3.   

    哈哈.知道了.参数不对.....把b1用System.Text.Encoding.ASCII.GetChars就转换下就OK拉~
    ======别光顾着高兴啊,把帖子结了先