Ejemplo n.º 1
0
        public string GetDecryptedData(string data)
        {
            EncryptDecryptData model = new EncryptDecryptData();

            //var key = "E546C8DF278CD5931069B522E695D4F2";
            return(model.DecryptString(data));
        }
Ejemplo n.º 2
0
        public CoreSQLConnection(string dbname = "")
        {
            StreamReader       r         = new StreamReader("server.json");
            EncryptDecryptData encrdecr  = new EncryptDecryptData();
            string             json      = r.ReadToEnd();
            List <connection>  file      = JsonConvert.DeserializeObject <List <connection> >(json);
            string             constring = "";

            foreach (var data in file)
            {
                if (dbname == "")
                {
                    constring = "Server=" + data.PCName + ";Database=" + data.Database + ";User Id=" + data.UserId + ";Password="******"Server=" + data.PCName + ";Database=" + dbname + ";User Id=" + data.UserId + ";Password=" + data.Password;
                }
            }
            dbConnection = constring;
        }