예제 #1
0
        public static string CriarHash(string hash)
        {
            crudPtServer crud   = new crudPtServer("");
            var          config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            if (string.IsNullOrEmpty(hash))
            {
                hash = Guid.NewGuid().ToString();
                crud.AtualizaScriptBanco();
                hash = crud.GetTBLocalHash(hash);
            }
            config.AppSettings.Settings["hash"].Value = hash;
            config.Save(ConfigurationSaveMode.Modified);

            ConfigurationManager.RefreshSection("appSettings");
            return(config.AppSettings.Settings["hash"].ToString());
        }
예제 #2
0
        public static string GetHash(string Url)
        {
            crudPtServer crud = new crudPtServer(Url);
            string       hash = ConfigurationManager.AppSettings["hash"].ToString();

            if (string.IsNullOrEmpty(hash))
            {
                try
                {
                    hash = crud.GetTBBancoLocalHash();
                }
                catch { }
            }
            crud.AtualizaScriptBanco();
            crud.LimpaTabelaHash();
            return(hash);
        }