Example #1
0
        private bool MyNetworkPlacesTest(string Path, bool isClose)
        {
            NetTranslate.KillLink(tbPathServer.Text);

            if (NetTranslate.connectState(Path, tbAccount.Text, tbPW.Text) == false)
            {
                return(false);
            }

            if (isClose)
            {
                NetTranslate.KillLink(tbPathServer.Text);
            }

            return(true);
        }
Example #2
0
        /// <summary>
        /// 檢查伺服器狀態
        /// </summary>
        /// <returns></returns>
        private bool MyNetworkPlacesTest()
        {
            if (_PathServer.Length <= 0)
            {
                return(false);
            }

            NetTranslate.KillLink(_PathServer);

            if (NetTranslate.connectState(_PathServer, _Account, _PW) == false)
            {
                return(false);
            }

            return(true);
        }
Example #3
0
        private static bool MyNetworkPlacesTest(string ServerPath)
        {
            string Account = string.Empty;
            string PW      = string.Empty;

            DaoSQL.Instance.GetServerAccount(out Account, out PW);

            NetTranslate.KillLink(ServerPath);

            if (NetTranslate.connectState(ServerPath, Account, PW) == false)
            {
                return(false);
            }

            NetTranslate.KillLink(ServerPath);

            return(true);
        }
Example #4
0
        private void FormBackup_Shown(object sender, EventArgs e)
        {
            //備份本機資料;//
            SetMsg("備份本機資料");
            BackupLocalData();
            SetProcess(33);
            Thread.Sleep(300);

            //檢查伺服器路徑是否可以連線;//
            if (MyNetworkPlacesTest() == false)
            {
                SetMsg("無法備份資料至伺服器,請檢察網路狀態或備份路徑設定。");
                SetProcess(66);
                Thread.Sleep(500);

                SetMsg("無法匯出報表至伺服器,請檢察網路狀態或備份路徑設定。");
                SetProcess(100);
                Thread.Sleep(500);
            }
            else
            {
                //備份資料至Server;//
                SetMsg("備份資料至伺服器");
                BackupToServer();
                SetProcess(66);
                Thread.Sleep(300);

                //匯出報表至Server;//
                SetMsg("匯出報表至伺服器");
                ExportDaliyReport();
                SetProcess(100);
                Thread.Sleep(300);
            }

            NetTranslate.KillLink(_PathServer);
            this.DialogResult = DialogResult.Cancel;
        }