Beispiel #1
0
        public DBManager(string ip, string port, string username, string password)
        {
            _ipAddr          = ip;
            _port            = port;
            _username        = username;
            _encryptPassword = SysUtil.EncryptDES(password, password);
            _connectString   = GetDBConnectionString();
            string connectState = TestConnect();

            if (connectState == "Open")
            {
                isConnectable = true;
                _state        = "Connectable";
                _errorMsg     = "0";
            }
            else
            {
                isConnectable = false;
                _errorMsg     = connectState;
            }
        }
Beispiel #2
0
        public string GetDBConnectionString()
        {
            string decryptedPassword = SysUtil.DecryptDES(_encryptPassword, "quality");

            return(string.Format(@"Data Source={0},{1};Network Library=DBMSSOCN;Initial Catalog=qualityDB;User ID={2};Password={3};", _ipAddr, _port, _username, decryptedPassword));
        }
Beispiel #3
0
        public static string GetDBConnectionString(string ip, string port, string username, string encrptyPassword)
        {
            string decryptedPassword = SysUtil.DecryptDES(encrptyPassword, "quality");

            return(string.Format(@"Data Source={0},{1};Network Library=DBMSSOCN;Initial Catalog=qualityDB;User ID={2};Password={3};", ip, port, username, decryptedPassword));
        }