示例#1
0
 protected void Application_Start()
 {
     AutoFac.Setup();
     Ef4.Setup();
     Mvc.Setup();
     Solr.Setup();
 }
示例#2
0
        /// <summary>
        ///     Setup DevMvcComponent
        /// </summary>
        private static void SetupDevMvcComponent()
        {
            // initialize DevMvcComponent
            // Configure this with add a sender email.
            var mailer = new CustomMailServer(
                AppVar.Name,
                Setting.SenderEmail,
                Setting.SenderEmailPassword,
                Setting.SmtpHost,
                Setting.SmtpMailPort,
                Setting.IsSmtpssl);

            Mvc.Setup(AppVar.Name, Setting.DeveloperEmail, Assembly.GetExecutingAssembly(), mailer);
            //Mvc.Mailer.QuickSend("*****@*****.**", "Hello", "Hello");
            Cookies = Mvc.Cookies;
            Caches  = Mvc.Caches;
        }
        static void Main(string[] args)
        {
            Mvc.Setup(System.Reflection.Assembly.GetExecutingAssembly());
            string passPhraseFileName = "passPhrase.txt";
            string encryptedFileName  = "encrypted.txt";

            while (true)
            {
                var prevPassPhrase    = File.Exists(passPhraseFileName) ? File.ReadAllText(passPhraseFileName) : "";
                var prevEncryptedtext = File.Exists(encryptedFileName) ? File.ReadAllText(encryptedFileName) : "";
                if (!string.IsNullOrEmpty(prevPassPhrase))
                {
                    Console.WriteLine("Previous Encrypted String:");
                    Console.WriteLine(prevPassPhrase);
                    Console.WriteLine("Previous Encrypted String as Decrypted:");
                    string tempDecryptedstring = Pbkdf2Encryption.Decrypt(prevEncryptedtext, prevPassPhrase);
                    Console.WriteLine(tempDecryptedstring);
                }
                Console.WriteLine("Please enter a pass phrase to use:");
                string passphrase = Console.ReadLine();
                Console.WriteLine("Please enter a string to encrypt:");
                string encryptingString = Console.ReadLine();
                Console.WriteLine("");

                Console.WriteLine("Your encrypted string is:");
                string encryptedstring = Pbkdf2Encryption.Encrypt(encryptingString, passphrase);
                File.WriteAllText(encryptedFileName, encryptedstring);
                File.WriteAllText(passPhraseFileName, passphrase);

                Console.WriteLine("Saved respective strings into encrypted.txt and passPhrase.txt inside the executing folder.");
                Console.WriteLine(encryptedstring);
                Console.WriteLine("");

                Console.WriteLine("Your decrypted string is:");
                string decryptedstring = Pbkdf2Encryption.Decrypt(encryptedstring, passphrase);
                Console.WriteLine(decryptedstring);
                Console.WriteLine("");

                Console.WriteLine("Press any key to exit...");
                Console.ReadLine();
            }
        }
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var assembly   = System.Reflection.Assembly.GetExecutingAssembly();
            var password   = "******";
            var mailServer = new GmailServer("testing email", "*****@*****.**", password);

            Mvc.Setup("DevMvcComponent Test", "*****@*****.**", assembly, mailServer);

            Mvc.Mailer.QuickSend("*****@*****.**", "subject", "<b>body</b>", isHtml: true);
            //try {
            //    throw new Exception("Hello World");
            //} catch (Exception ex) {
            //    Mvc.Error.ByEmail(ex, "[email protected],[email protected]", "Method Name", "Custom Subject", Mvc.Mailer);
            //}
            //Console.WriteLine("Done sending email");
        }