MEA+AAE+VGM+KGM:16795' FTX+AAI+++?CONTAINERSTOBESTOWEDAWAYFROMHEATANDTOBESTOREDUNDERDECK?' TDT+1++3++688888:172:87+++:172:87'
File.WriteAllLines(filePath, newLines);
string[] lines = File.ReadAllLines(filePath); foreach (string line in lines) // Read all line from the text file { oListBox.Items.Add(line); } foreach (var listBoxItem in oListBox.Items) { if (listBoxItem.ToString().Contains("?")) { string word = listBoxItem.ToString(); var oldLines = File.ReadAllLines(filePath); var newLines = oldLines.Where(line => !line.Contains(word));//delete the selected line File.WriteAllLines(filePath, newLines); FileStream oFileStream = new FileStream(filePath, FileMode.Append); oFileStream.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)