zoukankan      html  css  js  c++  java
  • 把一种类型的多个文件合并成一个文件的控制台程序

    static void Main(string[] args)
            {
                string currentDirectory = Environment.CurrentDirectory;
                string[] files = Directory.GetFiles(currentDirectory, "*.sql");
                string path = Path.Combine(currentDirectory, "all.sql");
                using (FileStream stream = File.Create(path))
                {
                    stream.Dispose();
                }
                foreach (string str3 in files)
                {
                    string str4 = Path.Combine(currentDirectory, str3);
                    if (path.ToLower() != str4.ToLower())
                    {
                        string contents = File.ReadAllText(str4, Encoding.UTF8) + "\r\n";
                        File.AppendAllText(path, contents);
                    }
                }
                }
  • 相关阅读:
    安装Manjaro KDE 18.04
    nltk 词性解析
    Ubuntu安装Hadoop
    Ubuntu安装JDK
    Python3-Cookbook总结
    linux 条件变量
    多线程编程 ------ 互斥量
    线程相关笔记
    realloc ------ 扩大malloc得到的内存空间
    gcc 消除未使用变量的警告
  • 原文地址:https://www.cnblogs.com/scottpei/p/2068586.html
Copyright © 2011-2022 走看看