private void button2_Click(object sender, EventArgs e)
        {
            fMain f = new fMain();

            f.Show();
            this.Close();
        }
Exemplo n.º 2
0
 private void btDangNhap_Click(object sender, EventArgs e)
 {
     try
     {
         conn.Open();
         string        tk  = txTaiKhoan.Text;
         string        mk  = txMatKhau.Text;
         string        sql = "Select * From DangNhap where TaiKhoan = '" + tk + "' and MatKhau = '" + mk + "' ";
         SqlCommand    cmd = new SqlCommand(sql, conn);
         SqlDataReader dta = cmd.ExecuteReader();
         if (dta.Read() == true)
         {
             MessageBox.Show("Đăng Nhập Thành Công");
             fMain f = new fMain();
             f.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Sai tài khoản hoặc mật khẩu");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Lỗi Kết Nối");
     }
 }
Exemplo n.º 3
0
        public static void OpenLog(Form currentForm, bool openForm = true, string path = "")
        {
            if (openForm == true)
            {
                fMain form = new fMain(path);
                form.Show();
                currentForm.Hide();
            }

            StreamReader streamR = new StreamReader(path);

            try
            {
                while (!streamR.EndOfStream)
                {
                    string line = streamR.ReadLine();

                    if (Regex.IsMatch(line, @"^\[Title: (.)*\]$"))
                    {
                        fMain.changelogTitle.Text = line.Substring(8, line.Length - 9);
                    }
                    else if (Regex.IsMatch(line, @"^\[Version: (.)*\]$"))
                    {
                        fMain.changelogVersion.Text = "Version " + line.Substring(10, line.Length - 11);
                    }
                    else if (Regex.IsMatch(line, @"^\[New feature: (.)*\]$"))
                    {
                        fMain.newFeatures.Items.Add(line.Substring(14, line.Length - 15));
                    }
                    else if (Regex.IsMatch(line, @"^\[Change: (.)*\]$"))
                    {
                        fMain.changes.Items.Add(line.Substring(9, line.Length - 10));
                    }
                    else if (Regex.IsMatch(line, @"^\[Fix: (.)*\]$"))
                    {
                        fMain.fixes.Items.Add(line.Substring(6, line.Length - 7));
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            finally
            {
                streamR.Close();
                AddLogToRecent(path);
            }
        }
Exemplo n.º 4
0
        public static void RUN()
        {
            //string s = api_crawler.getHtml("https://dictionary.cambridge.org/grammar/british-grammar/");
            //return;

            dicResponses = new Dictionary <string, msg>();
            dicService   = new Dictionary <string, IthreadMsg>();
            main         = new fMain();

            dicService.Add(_API.WORD_LOAD_LOCAL, new threadMsg(new api_word_LocalStore()));
            dicService.Add(_API.SETTING_APP, new threadMsg(new api_settingApp(), main.f_api_settingApp_responseMsg));
            dicService.Add(_API.FOLDER_ANYLCTIC, new threadMsg(new api_folder_Analytic()));
            dicService.Add(_API.CRAWLER, new threadMsg(new api_crawler()));
            dicService.Add(_API.YOUTUBE, new threadMsg(new api_youtube()));
            dicService.Add(_API.MP3, new threadMsg(new api_mp3()));

            //||| MAIN
            main.Shown         += main_Shown;
            main.FormClosing   += main_Closing;
            main.onNotifyClick += (se, ev) =>
            {
                if (main.isVisiable)
                {
                    main.isVisiable = false;
                    main.Hide();
                }
                else
                {
                    main.isVisiable = true;
                    main.Show();
                    main.Activate();
                }
            };

            f_media_Init();

            Application.Run(main);
        }
Exemplo n.º 5
0
 private void fBillManager_FormClosing(object sender, FormClosingEventArgs e)
 {
     formParent.Show();
 }