static void Main(string[] args)
 {
     try
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         //Application.Run(new frmGerenciamento());
         if (args[0] == "admin")
         {
             configurar con = new configurar();
             con.ShowDialog();//Process.Start(Directory.GetCurrentDirectory() + "\\config.exe");
         }
     }
     catch (System.IndexOutOfRangeException ex)
     {
         Application.Run(new TelaLogin());
         //Application.Run(new relaciona_notas());
         //Application.Run(new frmGerenciamento());
         //Application.Run(new CadastroNota());
         //Application.Run(new LocalidadesCadastradas());
     }
     //Application.Run(new CadastroNota());
     //Application.Run(new cadusers.cadusers1());
     //Application.Run(new UsuarioCadastrados());
     //Application.Run(new FornecedoresCadastrados());
     //Application.Run(new Relatorios.consulta_equipamento());
     //Application.Run(new update.atualiza_nota());
 }
Exemple #2
0
 private void btn_login_Click(object sender, EventArgs e)
 {
     try
     {
         login();
     }
     catch (System.IO.FileNotFoundException ex)
     {
         if (MessageBox.Show(null, "Arquivo de dados inexistente, deseja configura-lo agora?", "Pergunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
         {
             configurar con = new configurar();
             con.ShowDialog();
         }
         else
         {
         }
     }
 }
Exemple #3
0
        string deco()
        {
            String dec = "";

            try
            {
                System.IO.StreamReader file = new System.IO.StreamReader(Directory.GetCurrentDirectory() + "\\config.cfg");
                byte[] b = (Convert.FromBase64String(file.ReadLine()));
                dec = Encoding.UTF8.GetString(b);
                return(dec);
            }
            catch (System.IO.FileNotFoundException ex)
            {
                if (MessageBox.Show(null, "Arquivo de dados inexistente, deseja configura-lo agora?", "Pergunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                {
                    configurar con = new configurar();
                    con.ShowDialog();
                }
                else
                {
                }
                return(dec);
            }
        }