Created
September 16, 2014 19:24
-
-
Save gabrielgreen/329463a28cda9ebad2a5 to your computer and use it in GitHub Desktop.
quick console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static readonly StringBuilder Sb = new StringBuilder(); | |
private static void ShowResults() | |
{ | |
const string outputFile = "output.txt"; | |
File.WriteAllText(outputFile, Sb.ToString()); | |
Process.Start("notepad", outputFile); | |
} | |
private static void PrintJson(string title, IEnumerable<object> objects) | |
{ | |
Sb.AppendFormat("[{0}]", title); | |
foreach (var o in objects) | |
{ | |
Sb.AppendLine(JsonConvert.SerializeObject(o, Formatting.Indented)); | |
Sb.AppendLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment