From e77be06f6018c6859dff64704cd9b950c9bf3999 Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Wed, 8 May 2024 15:29:42 +0400 Subject: [PATCH] lab-7 some fixes (do not work) --- .../BlacksmithWorkshop/App.config | 4 ++-- .../BlacksmithWorkshop/Program.cs | 24 +++++++------------ .../BlacksmithWorkshopRestApi/Program.cs | 20 +++++++--------- .../appsettings.json | 4 ++-- 4 files changed, 21 insertions(+), 31 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/App.config b/BlacksmithWorkshop/BlacksmithWorkshop/App.config index 4525262..4f2239b 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/App.config +++ b/BlacksmithWorkshop/BlacksmithWorkshop/App.config @@ -5,7 +5,7 @@ - - + + \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs b/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs index 03bc363..cfe0ab0 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs @@ -35,21 +35,15 @@ namespace BlacksmithWorkshop _serviceProvider.GetService(); mailSender?.MailConfig(new MailConfigBindingModel { - MailLogin = - System.Configuration.ConfigurationManager.AppSettings["MailLogin"] ?? - string.Empty, - MailPassword = - System.Configuration.ConfigurationManager.AppSettings["MailPassword"] ?? - string.Empty, - SmtpClientHost = - System.Configuration.ConfigurationManager.AppSettings["SmtpClientHost"] ?? - string.Empty, - SmtpClientPort = - Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpClientPort"]), - PopHost = - System.Configuration.ConfigurationManager.AppSettings["PopHost"] ?? string.Empty, - PopPort = - Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["PopPort"]) + MailLogin = System.Configuration.ConfigurationManager.AppSettings["MailLogin"] + ?? string.Empty, + MailPassword = System.Configuration.ConfigurationManager.AppSettings["MailPassword"] + ?? string.Empty, + SmtpClientHost = System.Configuration.ConfigurationManager.AppSettings["SmtpClientHost"] + ?? string.Empty, + SmtpClientPort = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpClientPort"]), + PopHost = System.Configuration.ConfigurationManager.AppSettings["PopHost"] ?? string.Empty, + PopPort = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["PopPort"]) }); var timer = new System.Threading.Timer(new TimerCallback(MailCheck!), null, 0, 100000); diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Program.cs b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Program.cs index 1aab5ef..407d030 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Program.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Program.cs @@ -39,18 +39,14 @@ mailSender?.MailConfig(new MailConfigBindingModel { MailLogin = builder.Configuration?.GetSection("MailLogin")?.Value?.ToString() ?? string.Empty, - MailPassword = - builder.Configuration?.GetSection("MailPassword")?.Value?.ToString() ?? - string.Empty, - SmtpClientHost = - builder.Configuration?.GetSection("SmtpClientHost")?.Value?.ToString() ?? - string.Empty, - SmtpClientPort = - Convert.ToInt32(builder.Configuration?.GetSection("SmtpClientPort")?.Value?.ToString()), - PopHost = builder.Configuration?.GetSection("PopHost")?.Value?.ToString() ?? - string.Empty, - PopPort = - Convert.ToInt32(builder.Configuration?.GetSection("PopPort")?.Value?.ToString()) + MailPassword = builder.Configuration?.GetSection("MailPassword")?.Value?.ToString() + ?? string.Empty, + SmtpClientHost = builder.Configuration?.GetSection("SmtpClientHost")?.Value?.ToString() + ?? string.Empty, + SmtpClientPort = Convert.ToInt32(builder.Configuration?.GetSection("SmtpClientPort")?.Value?.ToString()), + PopHost = builder.Configuration?.GetSection("PopHost")?.Value?.ToString() + ?? string.Empty, + PopPort = Convert.ToInt32(builder.Configuration?.GetSection("PopPort")?.Value?.ToString()) }); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.json b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.json index 01ad592..c459107 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.json +++ b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.json @@ -10,6 +10,6 @@ "SmtpClientPort": "587", "PopHost": "pop.gmail.com", "PopPort": "995", - "MailLogin": "sasda3183@gmail.com", - "MailPassword": "ozxp vjof uinv fcmj" + "MailLogin": "r.for.labs@gmail.com", + "MailPassword": "keyy rroi mgyu yotq" }