private void button1_Click(object sender, EventArgs e)
        {
            string CompletPath = Assembly.GetExecutingAssembly().Location.Replace("\\SQLWebSiteManager.exe", "") + "\\SQLWEBSITEMANAGERCONFIG";

            if (!Directory.Exists(CompletPath))
            {
                Directory.CreateDirectory(CompletPath);
            }

            var textContent = $"{tbxLocalAdress.Text}|{tbxInternalUser.Text}|{tbxInternalPass.Text }|{tbxExternalAdress.Text }|{tbxUserExternal.Text }|{tbxPassExternal.Text }|{tbxConsulttable.Text}|{tbxPortInterna.Text}|{tbxPortExt.Text}";

            ReadText.GetInstace().GravaAquivoTxt(CompletPath + "\\SQLWEBSITE.CONFIG", textContent);

            this.Close();
        }
        private void Comfiguracoes_Load(object sender, EventArgs e)
        {
            string CompletPath = Assembly.GetExecutingAssembly().Location.Replace("\\SQLWebSiteManager.exe", "") + "\\SQLWEBSITEMANAGERCONFIG";

            if (!File.Exists(CompletPath + "\\SQLWEBSITE.CONFIG"))
            {
                return;
            }

            var content = ReadText.GetInstace().LeArquivoTxt(CompletPath + "\\SQLWEBSITE.CONFIG").Split('|');

            if (content.Length > 8)
            {
                tbxLocalAdress.Text    = content[0];
                tbxInternalUser.Text   = content[1];
                tbxInternalPass.Text   = content[2];
                tbxExternalAdress.Text = content[3];
                tbxUserExternal.Text   = content[4];
                tbxPassExternal.Text   = content[5];
                tbxConsulttable.Text   = content[6];
                tbxPortInterna.Text    = content[7];
                tbxPortExt.Text        = content[8];
            }
        }
Example #3
0
        public ConsultSQL()
        {
            string CompletPath = Assembly.GetExecutingAssembly().Location.Replace("\\SQLWebSiteManager.exe", "");
            var    vcontent    = ReadText.GetInstace().LeArquivoTxt(CompletPath + "\\SQLWEBSITEMANAGERCONFIG\\SQLWEBSITE.CONFIG").Split('|');

            content = new String[9];

            //  informações locais
            ConexaoInterna.GetInstace().Servidor = vcontent[0]; // endereço do banco
            ConexaoInterna.GetInstace().Login    = vcontent[1]; // usuario
            ConexaoInterna.GetInstace().Senha    = vcontent[2]; // senha
            ConexaoInterna.GetInstace().Porta    = vcontent[7]; // porta

            ConexaoInterna.GetInstace().IsConnect();

            //  Informações externas
            ConexaoExterna.GetInstace().Servidor = vcontent[3]; // endereço do banco
            ConexaoExterna.GetInstace().Login    = vcontent[4]; // usuario
            ConexaoExterna.GetInstace().Senha    = vcontent[5]; // senha
            ConexaoExterna.GetInstace().Porta    = vcontent[8]; // porta
            content[8] = vcontent[6];                           // tabela

            ConexaoExterna.GetInstace().IsConnect();
        }