- 603 名前:デフォルトの名無しさん mailto:sage [2010/05/30(日) 22:00:29 ]
- pc12.2ch.net/test/read.cgi/tech/1268699491/855
using System; using System.IO; using System.Collections; namespace _862 { class _862 { static void Main(string[] args) { ArrayList files = new ArrayList(); string[] fs = //folderにあるファイルを取得する System.IO.Directory.GetFiles(Directory.GetCurrentDirectory(), "test*.cpp"); files.AddRange(fs); //ArrayListに追加する foreach (string file in files) { StreamReader sr = new StreamReader(file); string buffer = sr.ReadToEnd(); sr.Close(); StreamWriter sw = new StreamWriter(file); sw.Write("#include \"stdafx.h\"\r\n" + buffer); sw.Close(); } } } }
|

|