Esempio n. 1
0
 /// <summary>
 /// Remove File URL from Bookmarks
 /// </summary>
 /// <param name="URL">URL to remove</param>
 public static void RemoveFile(string URL)
 {
     if (File.Exists(LocalExtensions.pathDataBookmarked))
     {
         TextLineRemover.RemoveTextLines(new List <string> {
             JsonConvert.SerializeObject(new Bookmark(URL))
         }, LocalExtensions.pathDataBookmarked, LocalExtensions.pathDataBookmarked + ".tmp");
     }
 }
Esempio n. 2
0
        static void Main()
        {
            List <string> str = new List <string>()
            {
                "Ivan"
            };

            TextLineRemover.RemoveTextLines(str, @"C:\Users\7\Desktop\result.txt", @"C:\Users\7\Desktop\res.txt");
        }
Esempio n. 3
0
 /// <summary>
 /// Remove File URL from Bookmarks
 /// </summary>
 /// <param name="url">URL to remove</param>
 public static void RemoveFile(string url)
 {
     if (File.Exists(LocalExtensions.PathBookmarks))
     {
         TextLineRemover.RemoveTextLines(new List <string> {
             JsonConvert.SerializeObject(new Bookmark(url))
         }, LocalExtensions.PathBookmarks, LocalExtensions.PathBookmarks + ".tmp");
     }
 }
 void Button13Click(object sender, EventArgs e)
 {
     if (listBox4.SelectedIndex >= 0)
     {
         TextLineRemover.RemoveTextLines(new List <string> {
             listBox4.SelectedItem.ToString()
         }, "ports.txt", "ports.tmp");
         listBox4.Items.Clear();
         string[] lines_ports = File.ReadAllLines("ports.txt");
         listBox4.Items.AddRange(lines_ports);
     }
 }
Esempio n. 5
0
 public void RemoveIPPortListing(ListBox box, string file, string file_tmp)
 {
     if (box != null)
     {
         if (box.SelectedIndex >= 0)
         {
             TextLineRemover.RemoveTextLines(new List <string> {
                 box.SelectedItem.ToString()
             }, file, file_tmp);
             box.Items.Clear();
             string[] lines = File.ReadAllLines(file);
             box.Items.AddRange(lines);
         }
     }
     else
     {
         //requires a ListBox.
         return;
     }
 }