Exemple #1
0
        private string SetSecret()
        {
            try
            {
                foreach (string val in Directory.GetFiles(string.Concat(Environment.CurrentDirectory, @"\Statistics\"), "*.csv", SearchOption.AllDirectories))
                {
                    arr = val.Split('\\');
                    arr = arr[arr.Length - 1].Split('.');
                    int count = int.Parse(arr[0]);

                    if (count > RecentDate)
                    {
                        RecentDate = count;
                    }
                }
                using StreamReader sr = new StreamReader(string.Concat(Environment.CurrentDirectory, @"\Statistics\", RecentDate.ToString(), ".csv"));
                List <string> list = new List <string>(256);

                if (sr != null)
                {
                    while (sr.EndOfStream == false)
                    {
                        list.Add(sr.ReadLine());
                    }
                }

                foreach (IMakeUp val in mp)
                {
                    MakeUp(list, val);
                }

                return(string.Concat(list[1].Substring(0, 8), "^", list[list.Count - 2].Substring(0, 8)));
            }
            catch (Exception ex)
            {
                Box.Show(string.Concat(ex.ToString(), "\n\nQuit the Program."), "Exception", 3750);
                Environment.Exit(0);
            }
            return(string.Empty);
        }
Exemple #2
0
        private string SetSecret()
        {
            try
            {
                foreach (string val in Directory.GetFiles(string.Concat(Path.Combine(Application.StartupPath, @"..\"), @"\Statistics\"), "*.csv", SearchOption.AllDirectories))
                {
                    arr = val.Split('\\');
                    arr = arr[arr.Length - 1].Split('.');
                    long count = long.Parse(arr[0]);

                    if (count > RecentDate)
                    {
                        RecentDate = count;
                    }
                }
                using StreamReader sr = new StreamReader(string.Concat(Path.Combine(Application.StartupPath, @"..\"), @"\Statistics\", RecentDate.ToString(), ".csv"));
                List <string> list = new List <string>(256);

                if (sr != null)
                {
                    while (sr.EndOfStream == false)
                    {
                        list.Add(sr.ReadLine());
                    }
                }

                foreach (IMakeUp val in mp)
                {
                    MakeUp(list, val);
                }

                return(string.Concat(list[1].Substring(0, 8), "^", list[list.Count - 2].Substring(0, 8)));
            }
            catch (Exception ex)
            {
                new LogMessage().Record("Error", ex.ToString());
                MessageBox.Show(string.Concat(ex.ToString(), "\n\nQuit the Program."), "Exception", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Environment.Exit(0);
            }
            return(string.Empty);
        }