Beispiel #1
0
        private void RegDB_Load(object sender, EventArgs e)
        {
            string str = Path.Combine(VMGlobal.ProfilePath, VMGlobal.ProfileFile);

            if (Directory.Exists(VMGlobal.ProfilePath))
            {
                try
                {
                    DBProfileData dBProfileDatum = (DBProfileData)FileCrypto.LoadConfig(str);
                    this.chk_LocalDB.Checked  = dBProfileDatum.IsLocalDB;
                    this.chk_Security.Checked = dBProfileDatum.PersistSecurityInfo;
                    this.DataSource.Text      = dBProfileDatum.DataSource;
                    this.Catalog.Text         = dBProfileDatum.Catalog;
                    this.UserID.Text          = dBProfileDatum.UserId;
                    vTextBox pwd1     = this.Pwd1;
                    vTextBox pwd2     = this.Pwd2;
                    string   password = dBProfileDatum.Password;
                    string   str1     = password;
                    pwd2.Text = password;
                    pwd1.Text = str1;
                }
                catch
                {
                }
            }
        }
Beispiel #2
0
        private CamProfile ReadAssetProfile(string DriveID)
        {
            CamProfile camProfile = new CamProfile();

            if (File.Exists(Path.Combine(DriveID, "C3Sentinel.Dat")))
            {
                camProfile = (CamProfile)FileCrypto.LoadConfig(Path.Combine(DriveID, "C3Sentinel.Dat"));
            }
            return(camProfile);
        }
Beispiel #3
0
        public CamProfile ReadAssetProfile(string DriveID)
        {
            CamProfile camProfile = new CamProfile();

            if (IsProfile(DriveID))
            {
                camProfile = (CamProfile)FileCrypto.LoadConfig(Path.Combine(DriveID, "C3Sentinel.Dat")) ?? new CamProfile();
            }
            return(camProfile);
        }
Beispiel #4
0
        public static void GetDBConnection()
        {
            if (!Directory.Exists(ProfilePath))
            {
                Directory.CreateDirectory(ProfilePath);
                Network.SetAcl(ProfilePath);
            }
            string str = Path.Combine(ProfilePath, ProfileFile);

            if (!File.Exists(str))
            {
                DBConnectionProfile = "C3Sentinel";
                return;
            }
            DBProfileData dBProfileDatum = (DBProfileData)FileCrypto.LoadConfig(str);

            if (dBProfileDatum.IsLocalDB)
            {
                DBConnectionProfile = "C3Sentinel";
                return;
            }
            object[] dataSource = new object[] { dBProfileDatum.DataSource, dBProfileDatum.Catalog, dBProfileDatum.PersistSecurityInfo, dBProfileDatum.UserId, dBProfileDatum.Password };
            DBConnectionProfile = string.Format("Data Source={0};Initial Catalog={1};Persist Security Info={2};User ID={3};Password={4}", dataSource);
        }