CSharp StatusReport

From scripting
Revision as of 05:07, 22 April 2017 by Nickpisca (talk | contribs) (Created page with " static void Main(string[] args) { while (true) { Thread.Sleep(2500); Console.Clear();...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  static void Main(string[] args)
        {
                while (true)
                {
                    Thread.Sleep(2500);
                    Console.Clear();
                    string[] fps = Directory.GetFiles(@"c:\xml");
                    if (fps.Count() > 0)
                    {
                        for (int x = 0; x < fps.Count(); x++)
                        {
                            try
                            {
                                using (StreamReader sr = new StreamReader(fps[x]))
                                {
                                    string line = sr.ReadLine();
                                    Console.WriteLine(line + "");
                                    sr.Close();
                                }
                                
                            }
                            catch
                            {
                                Console.WriteLine("Error: " + fps[x]);
                            }
                        }
                    }
                    else
                    {
                        break;
                    }
                }
        }  


This subroutine was used in the development of the Mega-Dots World's Toughest Connect-the-Dots Puzzles.

Unrelated MEL scripting help located here: YSYT.