private void button2_Click(object sender, EventArgs e) // creating new account { CreateUserAndPass f = new CreateUserAndPass(); this.Hide(); f.ShowDialog(); this.Close(); }
private void label4_Click(object sender, EventArgs e) // label click to register account { CreateUserAndPass f = new CreateUserAndPass(); this.Hide(); f.ShowDialog(); this.Close(); }
private void button1_Click(object sender, EventArgs e) { String fileLocation = System.Reflection.Assembly.GetEntryAssembly().Location; String myFileName = "pass&user.txt"; String [] fileLocationSpliter = fileLocation.Split('\\'); String myFileNameSpliter = fileLocationSpliter[fileLocationSpliter.Length - 1]; fileLocation = fileLocation.Replace("\\SavingHiddenFile.exe", "\\" + myFileName); try { //FileInfo newFile = new FileInfo("file.txt"); //newFile.Attributes = FileAttributes.Normal; StreamReader rd = new StreamReader(fileLocation); String info = rd.ReadLine(); MessageBox.Show(info); rd.Close(); FileInfo newFile = new FileInfo(myFileName); newFile.Attributes = FileAttributes.Normal; } catch (Exception exc) { CreateUserAndPass f = new CreateUserAndPass(); this.Hide(); f.ShowDialog(); this.Close(); /*StreamWriter wr = new StreamWriter(fileLocation); * wr.WriteLine("I write Something Here for the first time!"); * FileInfo newFile = new FileInfo(myFileName); * newFile.Attributes = FileAttributes.Normal; * wr.Close();*/ } MessageBox.Show("Done!"); }