Пример #1
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            bool EULAAccepted = false;

            do
            {
                //Чтение файла
                if (!File.Exists(Application.UserAppDataPath + "\\EULA.txt"))
                {
                    EULAAccepted = false;
                    EULAWindow newEULA = new EULAWindow();
                    newEULA.ShowDialog();
                }
                else
                {
                    try
                    {
                        string data = File.ReadAllText(Application.UserAppDataPath + "\\EULA.txt", Encoding.Default);
                        if (data == "TRUE")
                        {
                            EULAAccepted = true;
                        }
                        else
                        {
                            EULAAccepted = false;
                            EULAWindow newEULA = new EULAWindow();
                            newEULA.ShowDialog();
                        }
                    }
                    catch (Exception)
                    {
                        EULAAccepted = false;
                    }
                }

                //Чтение файла
                if (!File.Exists(Application.UserAppDataPath + "\\EULA.txt") && !EULAAccepted)
                {
                    EULAAccepted = false;
                }
                else
                {
                    try
                    {
                        string data = File.ReadAllText(Application.UserAppDataPath + "\\EULA.txt", Encoding.Default);
                        if (data == "TRUE")
                        {
                            EULAAccepted = true;
                        }
                        else
                        {
                            EULAAccepted = false;
                        }
                    }
                    catch (Exception)
                    {
                        EULAAccepted = false;
                    }
                }
            } while (!EULAAccepted);

            Focus();
        }
Пример #2
0
        private void eULAToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EULAWindow newEULA = new EULAWindow();

            newEULA.ShowDialog();
        }