Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void DeleteCategory(String category, bool withPassword = true, String destination = "Misc")
- {
- using (StreamReader reader = new StreamReader(
- _fileStream,
- Encoding.Unicode,
- detectEncodingFromByteOrderMarks: true,
- bufferSize: 4096,
- leaveOpen: true
- )
- )
- {
- if (withPassword == true)
- {
- _fileStream.Position = _fileStream.Seek(0, SeekOrigin.Begin); // Metodo che cancella tutte le password se withPassword è true
- String strcat, strlabel, strline;
- while (!reader.EndOfStream)
- {
- strline = reader.ReadLine(); // Salvo la linea letta
- strlabel = strline.Substring(strline.IndexOf('.')); // Creazione di una sottostringa a partire dal punto
- strcat = strline.Substring(0, strline.Length - strlabel.Length); // Creazione di una sottostringa a partire dall'inizio di strline che ha lunghezza pari a quella di strline - strlabel
- if (strcat == category)
- RemovePass(strlabel, strcat);
- }//while
- }//if
- else
- {
- }
- }//using
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement