public class UserModel
{
public string FirstName { get; set; }
public string LastName { get; set; }
public List<AccountModel> Accounts { get; set; } = new List<AccountModel>();
}
public class AccountModel
{
public string AccountType { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public AccountModel(string account_type, string email, string password)
{
this.AccountType = account_type;
this.Email = email;
this.Password = password;
}
}
_userList.Add(new UserModel() {
FirstName = "Jack",
LastName = "The Sparrow",
Accounts = new List<AccountModel>()
{
new AccountModel("Yandex","rambler@mail.ru","321312"),
new AccountModel("Yandex","rambler@mail.ru","321312"),
}
});
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter your name: ");
string name = Console.ReadLine();
char[] charArr = name.ToCharArray();
Array.Reverse(charArr);
string reName = string.Join("",charArr);
Console.WriteLine(reName);
Console.ReadKey();
}
}
double x1;
if(double.TryParse(textBox1.Text,out x1))
{
double x2 = x1 * 3;
double y;
y = Math.Sqrt(56 + ((x1 + x2 + Math.Sin(x1 * x2)) / (5 * Math.Cos(Math.Pow(x2, 2)))));
textBox2.Text = $"Х равен {x1} Значение y {y}";
}
else
{
MessageBox.Show("Значение введено не верно!!!");
textBox1.Text = "";
textBox2.Text = "";
}
KeyPreview = true;
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Home)
{
this.Opacity = 0.9;
}
}
if(e.KeyChar == 'д')
{
Application.Exit();
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.L)
{
Application.Exit();
}
}
do
{
//Тут что надо делать. Или не надо.
} while (Console.ReadKey().Key != ConsoleKey.L);
static void Main(string[] args)
{
Random rnd = new Random();
string [] countries = { "Украина", "Казахстан", "Беларусь", "Киргизия", "Эстония","США" };
List<string> uniqueCountry = new List<string>();
int number;
for (int i = 0; i < countries.Length; i++)
{
do
{
number = rnd.Next(0, countries.Length);
} while (uniqueCountry.Contains(countries[number]));
uniqueCountry.Add(countries[number]);
}
foreach (var item in uniqueCountry)
{
Console.WriteLine(item);
}
Console.ReadKey();
}