static void Main() { var container = BuildUnityContainer(); MailLogic.MailConfig(new MailConfig { SmtpClientHost = ConfigurationManager.AppSettings["SmtpClientHost"], SmtpClientPort = Convert.ToInt32(ConfigurationManager.AppSettings["SmtpClientPort"]), MailLogin = ConfigurationManager.AppSettings["MailLogin"], MailPassword = ConfigurationManager.AppSettings["MailPassword"], }); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var form = new FormAuthorization(); form.ShowDialog(); if (Email == "123" && Password == "123") { Application.Run(container.Resolve <FormAdmin>()); } else { MessageBox.Show("Неверный логин или пароль", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static void Main(string[] args) { MailLogic.MailConfig(new MailConfig { SmtpClientHost = ConfigurationManager.AppSettings["SmtpClientHost"], SmtpClientPort = Convert.ToInt32(ConfigurationManager.AppSettings["SmtpClientPort"]), MailLogin = ConfigurationManager.AppSettings["MailLogin"], MailPassword = ConfigurationManager.AppSettings["MailPassword"], }); CreateHostBuilder(args).Build().Run(); }
public Startup(IConfiguration configuration) { Configuration = configuration; MailLogic.MailConfig(new MailConfig { SmtpClientHost = configuration["SmtpClientHost"], SmtpClientPort = Convert.ToInt32(configuration["SmtpClientPort"]), MailLogin = configuration["MailLogin"], MailPassword = configuration["MailPassword"], }); }
static void Main() { var container = BuildUnityContainer(); MailLogic.MailConfig(new MailConfig { SmtpClientHost = ConfigurationManager.AppSettings["SmtpClientHost"], SmtpClientPort = Convert.ToInt32(ConfigurationManager.AppSettings["SmtpClientPort"]), MailLogin = ConfigurationManager.AppSettings["MailLogin"], MailPassword = ConfigurationManager.AppSettings["MailPassword"], }); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(container.Resolve <FormEnter>()); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var container = BuildUnityContainer(); MailLogic.MailConfig(new MailConfig { SmtpClientHost = ConfigurationManager.AppSettings["SmtpClientHost"], SmtpClientPort = Convert.ToInt32(ConfigurationManager.AppSettings["SmtpClientPort"]), MailLogin = ConfigurationManager.AppSettings["MailLogin"], MailPassword = ConfigurationManager.AppSettings["MailPassword"] }); var loginWindow = container.Resolve <LoginWindow>(); loginWindow.ShowDialog(); }
public static void Main() { var container = BuildUnityContainer(); MailLogic.MailConfig(new MailConfig { SmtpClientHost = ConfigurationManager.AppSettings["SmtpClientHost"], SmtpClientPort = Convert.ToInt32(ConfigurationManager.AppSettings["SmtpClientPort"]), MailLogin = ConfigurationManager.AppSettings["MailLogin"], MailPassword = ConfigurationManager.AppSettings["MailPassword"], }); // создаем таймер var timer = new System.Threading.Timer(new TimerCallback(MailCheck), new MailCheckInfo { PopHost = ConfigurationManager.AppSettings["PopHost"], PopPort = Convert.ToInt32(ConfigurationManager.AppSettings["PopPort"]), Logic = container.Resolve <IMessageInfoLogic>() }, 0, 10000); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(container.Resolve <FormMain>()); }