-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pUSH QILGANDA NEGADIR FAYLLAR SAQLANMAYABDI
- Loading branch information
1 parent
32f72ee
commit fdc1984
Showing
7 changed files
with
280 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Mail; | ||
using System.Net; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using Imtihon_Update.Interfaces; | ||
namespace Imtihon_Update | ||
{ | ||
internal class DispatchEmail | ||
public static class DispatchEmail | ||
|
||
{ | ||
} | ||
} | ||
//ismiz | ||
/*var name = Console.ReadLine(); | ||
Console.WriteLine("email"); | ||
var email = Console.ReadLine(); | ||
Console.WriteLine("enter passaword"); | ||
var pass = Console.ReadLine(); | ||
var Email = new EmailService(email, pass); | ||
Email.SendEmail(email, name);*/ | ||
|
||
public static bool SendEmail(string receiverEmail, string name) | ||
{ | ||
try | ||
{ | ||
var CredentialAddress = "[email protected]"; | ||
var CredentialPassword = "bypucbhumkeghlab"; | ||
|
||
var mail = new MailMessage(CredentialAddress, receiverEmail); | ||
mail.Subject = "Siz muvaffaqiyatli registratsiyadan o'tdingiz"; | ||
mail.Body = "Hurmatli {{User}}, siz sistemadan muvaffaqiyatli o'tdingiz Tabriklaymiz".Replace("{{User}}", name); | ||
var smtpClient = new SmtpClient("smtp.gmail.com", 587); // | ||
smtpClient.Credentials = new NetworkCredential(CredentialAddress, CredentialPassword); | ||
smtpClient.EnableSsl = true; | ||
|
||
smtpClient.Send(mail); | ||
return true; | ||
} | ||
catch { return false; } | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,52 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
Console.WriteLine("Hello, World!"); | ||
using Imtihon_Update; | ||
using Imtihon_Update.Interfaces; | ||
var Registrationservice = new RegistrationService(); | ||
bool exit = true; | ||
while (exit) | ||
{ | ||
Console.WriteLine("Dastruni tuxtatish uchun [e] ni bosing"); | ||
Console.WriteLine("Ruyhatdan utish uchun [r] va bizning a'zolarimizni kurish uchun[d] ni bosing"); | ||
var check = Console.ReadLine().ToLower(); | ||
switch (check) | ||
{ | ||
case "e": | ||
Console.Clear(); | ||
exit = false; | ||
break; | ||
case "r": | ||
Console.Clear(); | ||
Console.WriteLine("Enter Name "); | ||
string ism = Console.ReadLine(); | ||
Console.WriteLine("Enter FirstName: "); | ||
string familya = Console.ReadLine(); | ||
Console.WriteLine("Enter Middle Name: "); | ||
string sharif = Console.ReadLine(); | ||
Console.WriteLine("Enter email Address: "); | ||
string email = Console.ReadLine(); | ||
Console.WriteLine("Enter a username"); | ||
string username = Console.ReadLine(); | ||
Registrationservice.Register(ism, familya, sharif, email, username); | ||
//Registrationservice.Register(ism, familya, sharif, email, username); | ||
break; | ||
case "d": | ||
Console.Clear(); | ||
Registrationservice.Display(); | ||
break; | ||
default: | ||
Console.WriteLine("Bunday komanda yuq dasturdan xato foydalandingiz"); | ||
break; | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters