void importAccounts() { string accountLocation = Environment.CurrentDirectory + @"\Data\accounts.txt"; FileHandlingUtilites f = new FileHandlingUtilites(); linkedList = f.importToLinkedList(accountLocation); }
void importLogFile() { FileHandlingUtilites f = new FileHandlingUtilites(); string fileDirectory = Environment.CurrentDirectory + @"\Data\Profiles\" + accountName + @"\" + userName + @"\likedVideos.txt"; f.createFile(fileDirectory); stack = f.importToStack(fileDirectory); }
private void addUserAndPassword() { FileHandlingUtilites f = new FileHandlingUtilites(); string fileDirectory = Environment.CurrentDirectory + @"\Data\Profiles\" + currentAccount + "/"; f.WriteData((fileDirectory + currentAccount + "Profiles.txt"), inputBox(false)); f.WriteData((fileDirectory + currentAccount + "Passwords.txt"), inputBox(true)); storeProfiles(); }
public Hashing(string path) { FileHandlingUtilites f = new FileHandlingUtilites(); name = f.readAllFiles(path); finalstring = new string[name.Length]; size = name.Length; visited = new int[size]; }
// ? A Utility Function Loads & Runs The Selected Video Title/ThumbNail private void listView1_MouseClick(object sender, MouseEventArgs e) { this.Hide(); string selected = listView1.SelectedItems[0].Text; string fileDirectory = Environment.CurrentDirectory + @"\Data\Profiles\" + accountName + @"\" + userName + @"\Log.txt"; FileHandlingUtilites f = new FileHandlingUtilites(); f.WriteData(fileDirectory, selected); VideoPlayer j = new VideoPlayer(userName, accountName, selected, profileIndex); j.Show(); }
private void storeData(string fileDirectory, string content) { FileHandlingUtilites f = new FileHandlingUtilites(); f.WriteData(fileDirectory, content); }
private void storeProfiles() { FileHandlingUtilites f = new FileHandlingUtilites(); userCount = 0; string fileDirectory = Environment.CurrentDirectory + @"\Data\Profiles\" + currentAccount + @"\"; f.createDirectory(fileDirectory); string accountsDirectory = fileDirectory + currentAccount + "Profiles.txt"; f.createFile(accountsDirectory); FileStream accountsFile = new FileStream(accountsDirectory, FileMode.Open, FileAccess.Read); StreamReader accountStream = new StreamReader(accountsFile); string passwordDirectory = fileDirectory + currentAccount + "Passwords.txt"; f.createFile(passwordDirectory); FileStream passwordFile = new FileStream(passwordDirectory, FileMode.Open, FileAccess.Read); StreamReader passwordStream = new StreamReader(passwordFile); accountStream.BaseStream.Seek(0, SeekOrigin.Begin); passwordStream.BaseStream.Seek(0, SeekOrigin.Begin); string passwordStr = "", accountStr = ""; while ((accountStr != null || passwordStr != null)) { accountStr = accountStream.ReadLine(); passwordStr = passwordStream.ReadLine(); if (userCount == size || accountStr == "" || passwordStr == "") { accountStream.Close(); passwordStream.Close(); accountsFile.Close(); passwordFile.Close(); break; } if (accountStr != null && passwordStr != null) { if (accountStr != "\n" || accountStr != "" || passwordStr != "\n" || passwordStr != "") { string imageLocation = Environment.CurrentDirectory + @"\Data\Profiles\Profiles Icons\" + (userCount).ToString() + ".png"; Console.WriteLine(userCount + "\n"); profiles[userCount] = accountStr; passwords[userCount] = passwordStr; switch (userCount) { case 0: ID1.ImageLocation = imageLocation; ID1.SizeMode = PictureBoxSizeMode.Zoom; label1.Text = accountStr; break; case 1: ID2.ImageLocation = imageLocation; ID2.SizeMode = PictureBoxSizeMode.Zoom; label2.Text = accountStr; break; case 2: ID3.ImageLocation = imageLocation; ID3.SizeMode = PictureBoxSizeMode.Zoom; label3.Text = accountStr; break; case 3: ID4.ImageLocation = imageLocation; ID4.SizeMode = PictureBoxSizeMode.Zoom; label4.Text = accountStr; break; case 4: ID5.ImageLocation = imageLocation; ID5.SizeMode = PictureBoxSizeMode.Zoom; label5.Text = accountStr; break; } userCount++; } } } accountStream.Close(); passwordStream.Close(); accountsFile.Close(); passwordFile.Close(); }