Exemplo n.º 1
0
        private void btnLinkTest_Click(object sender, EventArgs e)
        {
            this.btnLinkTest.Enabled = false;
            bool mesFlg = messageCheck();

            if (mesFlg)
            {
                this.btnLinkTest.Enabled = true;
                return;
            }
            NetWorkFileShare netWorkFileShare = new NetWorkFileShare();
            string           serverFolderPath = @"\\" + this.txtTrIp.Text.Trim();

            if (netWorkFileShare.ConnectState(serverFolderPath, txtTraccount.Text.Trim(), txtTrPass.Text.Trim()))
            {
                MsgHelper.InfoMsg(ValidationRegex.C001, ValidationRegex.publicTitle);
                this.connectFlg           = true;
                this.btnReference.Enabled = true;
            }
            else
            {
                MsgHelper.InfoMsg(ValidationRegex.C002, ValidationRegex.publicTitle);
                this.connectFlg           = false;
                this.btnReference.Enabled = false;
            }
            this.btnLinkTest.Enabled = true;
        }
Exemplo n.º 2
0
        private void buttonTest_Click(object sender, EventArgs e)
        {
            NetWorkFileShare netWorkFileShare = new NetWorkFileShare();
            string           sharePath        = @"\\" + this.textBoxIP.Text.Trim();

            if (netWorkFileShare.ConnectState(sharePath, textBoxUserID.Text.Trim(), textBoxPassword.Text.Trim()))
            {
                MsgHelper.InfoMsg(ValidationRegex.C001, ValidationRegex.publicTitle);
                this.buttonTest.Enabled      = false;
                this.connectFlg              = true;
                this.buttonCopyStart.Enabled = true;
            }
            else
            {
                MsgHelper.InfoMsg(ValidationRegex.C002, ValidationRegex.publicTitle);
                this.buttonTest.Enabled      = true;
                this.connectFlg              = false;
                this.buttonCopyStart.Enabled = false;
            }
        }