Advertisement
Guest User

Untitled

a guest
Mar 16th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.53 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.IO;
  9. using System.Windows.Forms;
  10.  
  11. namespace savingModule
  12. {
  13.     public partial class Saving : Form
  14.     {
  15.         public string username;
  16.         public string password;
  17.         public string email;
  18.  
  19.        public string usernameSaved;
  20.        public string passwordSaved;
  21.        public string emailSaved;
  22.      
  23.  
  24.         public void write()
  25.         {
  26.             String[] data = { username, password, email };
  27.             System.IO.File.WriteAllLines(@"C:\\Users\\Jake\\Desktop\\saves\\saves.txt", data);
  28.         }
  29.  
  30.         public void read()
  31.         {
  32.             StreamReader stream = new StreamReader(@"C:\\Users\\Jake\\Desktop\\saves\\saves.txt");
  33.    
  34.                 usernameSaved = stream.ReadLine();
  35.                 Console.WriteLine("test");
  36.         }
  37.  
  38.         public Saving()
  39.         {
  40.             InitializeComponent();
  41.         }
  42.  
  43.  
  44.  
  45.         private void Saving_Load(object sender, EventArgs e)
  46.         {
  47.  
  48.         }
  49.  
  50.         private void button1_MouseClick(object sender, MouseEventArgs e)
  51.         {
  52.             username = usernameBox.Text + "\n";
  53.             password = passwordBox.Text + "\n";
  54.             email = emailBox.Text + "\n";
  55.             label4.Text = usernameSaved;
  56.             write();
  57.             read();
  58.         }
  59.  
  60.         private void label4_Click(object sender, EventArgs e)
  61.         {
  62.  
  63.         }
  64.        
  65. }
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement