Wednesday, May 2, 2018

Take the code with you on a trip

This short code snipped helps to aggregate all project sources in one file to read from reader on a trip

static void Main(string [] args)
        {
            string dir = args[0];
            string outputPath = args[1];
            string pattern = (args.Length > 2) ? args[2] : "*";
            StringBuilder b = new StringBuilder();
            foreach (string file in Directory.GetFiles(dir, pattern, SearchOption.AllDirectories))
            {
                b.Append(file);
                b.Append(Environment.NewLine);
                b.Append(File.ReadAllText(file));
                b.Append(Environment.NewLine);
            }

            File.WriteAllText(outputPath, b.ToString());
        }

No comments:

debug magazine archive

  71 jounals still available on issuu with great story of netlabels time.  debug_mag Publisher Publications - Issuu