Ejemplo n.º 1
0
 public static void Main()
 {
     Application.Init();
     win = new MainWindow();
     win.ShowAll();
     Application.Run();
 }
Ejemplo n.º 2
0
        public static void Main()
        {
            string        path = Directory.GetCurrentDirectory();               //Место где лежит наша программа
            List <string> valueSettings;

            pathSettingsFile = path + Path.AltDirectorySeparatorChar + @"settings.txt";
            if (!Directory.Exists(path + Path.AltDirectorySeparatorChar + @"log"))
            {                               // Если нет папки то создаем
                Directory.CreateDirectory(path + Path.AltDirectorySeparatorChar + @"log");
            }

            if (!Directory.Exists(path + Path.AltDirectorySeparatorChar + @"out"))
            {                               // Если нет папки то создаем
                Directory.CreateDirectory(path + Path.AltDirectorySeparatorChar + @"out");
            }
            pathOutFileFreq = path + Path.AltDirectorySeparatorChar + @"out" + Path.AltDirectorySeparatorChar + "freq_" + DateTime.Now.Year + "." + DateTime.Now.Month + "." + DateTime.Now.Day + " " + DateTime.Now.Hour + "." + DateTime.Now.Minute + "." + DateTime.Now.Second + ".txt";
            pathOutFileSp   = path + Path.AltDirectorySeparatorChar + @"out" + Path.AltDirectorySeparatorChar + "Sp_" + DateTime.Now.Year + "." + DateTime.Now.Month + "." + DateTime.Now.Day + " " + DateTime.Now.Hour + "." + DateTime.Now.Minute + "." + DateTime.Now.Second + ".txt";
            pathLog         = path + Path.AltDirectorySeparatorChar + @"log" + Path.AltDirectorySeparatorChar + DateTime.Now.Year + "." + DateTime.Now.Month + "." + DateTime.Now.Day + " " + DateTime.Now.Hour + "." + DateTime.Now.Minute + "." + DateTime.Now.Second + ".txt";
            if (File.Exists(pathSettingsFile))             // Если есть файла с настройками, то записываем их в переменные
            {
                string valueSettingsText = File.ReadAllText(pathSettingsFile);
                valueSettings = valueSettingsText.Split(',').ToList();

                MainClass.tempBegin = Convert.ToInt32(valueSettings[0]);
                MainClass.tempEnd   = Convert.ToInt32(valueSettings[1]);
                MainClass.tempStep  = Convert.ToInt32(valueSettings[2]);

                MainClass.timeSp  = Convert.ToInt32(valueSettings[3]);
                MainClass.timeSp1 = Convert.ToInt32(valueSettings[4]);

                MainClass.entryMSD = Convert.ToDouble(valueSettings[5]);
                MainClass.comPort  = valueSettings[6];
            }

            //				FileStream file1 = new FileStream(pathSettingsFile, FileMode.Open);
            //StreamWriter writer = new StreamWriter(file1);
            //writer.WriteLine("asd");
            //				writer.Close();



            Application.Init();
            win = new MainWindow();
            win.ShowAll();
            Application.Run();
        }