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);
}
}
}
转载于:https://www.cnblogs.com/scottpei/archive/2011/06/02/2068586.html