示例#1
0
        private void btnSxGeoInfo_Click(object sender, EventArgs e)
        {
            SxGeoDB tmpSxDB = new SxGeoDB(SxPath);

            if (!tmpSxDB.OpenDB())
            {
                lblMessage.ForeColor     = Color.Red;
                lblMessage.Text          = tmpSxDB.ErrorMessage;
                lblSxGeoStatus.Text      = "Ошибка.";
                lblSxGeoStatus.ForeColor = Color.Brown;
                return;
            }
            frmInfo fInfo = new frmInfo();

            fInfo.Header = tmpSxDB.GetHeader();
            fInfo.DBPath = SxPath;
            fInfo.ShowDialog();
            tmpSxDB.CloseDB();
        }
示例#2
0
        public bool IsValidSxGeoFile()
        {
            if (!File.Exists(DatabasePath))
            {
                ErrorMessage = "Файл данных SxGeo не найден.";
                return(false);
            }

            SxGeoDB tmpDB = new SxGeoDB(DatabasePath);

            tmpDB.DatabaseMode = SxGeoMode.FileMode;
            if (!tmpDB.OpenDB())
            {
                ErrorMessage = tmpDB.ErrorMessage;
                return(false);
            }

            tmpDB.CloseDB();
            return(true);
        }
示例#3
0
 public void Close()
 {
     db.CloseDB();
 }