Exemple #1
0
        private void btn_sure_Click(object sender, EventArgs e)
        {
            String adminName = this.tbox_username.Text.Trim();
            String adminPwd  = this.tbox_password.Text.Trim();

            if ("".Equals(adminName) || "".Equals(adminPwd))
            {
                MessageBoxEx.Show("请填写完整!   ");
            }
            else
            {
                System.Security.Cryptography.MD5 md5 = new MD5CryptoServiceProvider();
                byte[]       output = md5.ComputeHash(Encoding.Default.GetBytes(adminPwd));
                string       md5Pwd = BitConverter.ToString(output).Replace("-", "").ToLower();
                FileDBHelper fbh    = new FileDBHelper();
                fbh.saveUserAndPwd(adminName, md5Pwd);
                if (fbh.GetSucces())
                {
                    isSuccess = true;
                }
                else
                {
                    isSuccess = false;
                }
                this.DialogResult = DialogResult.OK;
            }
        }
Exemple #2
0
        private void DeleteFile(Int32 i)
        {
            FileDBHelper fileDBHelper = new FileDBHelper();

            fileDBHelper.deleteFile(i);
            if (fileDBHelper.GetSucces())
            {
                refreshDataGridView();
            }
        }
Exemple #3
0
        private void deleteFileNode(int nodeID)
        {
            this.Invoke(new MethodInvoker(delegate {
                imgLoadding.Visible = true;
            }));
            FileDBHelper fdbHelper = new FileDBHelper();

            fdbHelper.deleteFileNode(nodeID);
            if (fdbHelper.GetSucces())
            {
                loadData();
            }
            this.Invoke(new MethodInvoker(delegate {
                imgLoadding.Visible = false;
            }));
        }
Exemple #4
0
        private void insertFiles(FileInfo[] fileInfos, int nodeID)
        {
            FileDBHelper imgHelper = new FileDBHelper();

            this.Invoke(new MethodInvoker(delegate
            {
                imgLoadding.Visible = true;
            }));
            imgHelper.InsertFiles(fileInfos, nodeID);
            if (imgHelper.GetSucces())
            {
                refreshDataGridView();
            }
            this.Invoke(new MethodInvoker(delegate
            {
                imgLoadding.Visible = false;
            }));
        }