管理员,我没法发帖子,说有什么非法字符!

解决方案 »

  1.   


    StreamReader sr = new StreamReader(pathstr);string content = sr.ReadToEnd();
    sr.Close();写
    StreamWriter sw = File.AppendText(@"E:\output.txt");
    //StreamWriter sw = new StreamWriter(@"E:\output.txt");sw.WriteLine(“xxxx”);sw.Close();
      

  2.   

    一个txt文本有一行一行数据,读出每一行加个前缀再写入……

    如:
    csdn1
    csdn2
    ……
    csdn*
    =================之后
    woai      csdn1
    woai      csdn2
    woai      ……
    woai      csdn*
      

  3.   

    一个txt文本有一行一行数据,读出每一行加个前缀再写入……如:
    csdn1  |   csdn2|……|csdn*=================之后woai csdn1
    woai csdn2
    woai ……
    woai csdn*
      

  4.   

    Access怎么备份?网上搜了没试验成功!有具体实例和经验的回复一下哦。
      

  5.   

    StreamReader reader = new StreamReader("E:\\AA.txt", Encoding.GetEncoding("gb2312"));
                string str = reader.ReadLine();
                while (!string.IsNullOrEmpty(str))
                {
                    line++;
                    str = reader.ReadLine();
                }
                reader.Close();
    File.WriteAllTest,AppendText
    split分割
    角色模板等实现权限管理
    public static void Backup(string srcPath,string aimPath) 
            { 
                if (!File.Exists(srcPath)) 
                { 
                    throw new Exception("源数据库不存在,无法备份"); 
                } 
                try 
                { 
                    File.Copy(srcPath,aimPath,true); 
                } 
                catch(IOException ixp) 
                { 
                    throw new Exception(ixp.ToString()); 
                } 
                
      

  6.   

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;namespace help
    {
        public partial class Form1 : Form
        {
            private StreamReader streamR;
            private StreamWriter streamW;        public Form1()
            {
                InitializeComponent();
               streamR      = new StreamReader(@"d:\a.txt");
               streamW      = File.AppendText(@"d:\b.txt"); 
               while (true)
               {
                   string b = streamR.ReadLine();
                   if (b==null)
                   {
                       
                       streamW.Flush();
                       streamW.Close();
                       break;
                   }
                   streamW.Write("csdn  ");               streamW.WriteLine(b);            
               }
            }            }
    }测试通过,修改后的文件为b.txt,如果你认为文件名需相同,执行完后修改名称覆盖就可以了
      

  7.   

    File.Copy()
    以前我用的这个备份数据库,不过看到网上有把数据库弄成bak后缀备份的。