书签编辑(过滤器链接)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了书签编辑(过滤器链接)相关的知识,希望对你有一定的参考价值。

This is a simple example to quickly and easily produce a set of links for a given site in your bookmarks from Firefox..
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace htmlParse
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. List<string> yt_links = new List<string>();
  15. //list of (html code <A> </A> for a link).
  16.  
  17.  
  18. StreamReader sr = new StreamReader(@"F:/old-bookmarks.html");
  19. string line = "";
  20.  
  21. while ( (line = sr.ReadLine()) != null )
  22. {
  23. //..
  24.  
  25. //contains youtube link?
  26. if(line.Contains("A HREF="http://www.youtube.com/watch"))
  27. {
  28. yt_links.Add(line);
  29. }
  30.  
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37. StreamWriter sw = new StreamWriter(@"F:yt_old_bookmarks.html");
  38. sw.WriteLine("<!DOCTYPE NETSCAPE-Bookmark-file-1>" +
  39. "<!-- This is an automatically generated file." +
  40. " It will be read and overwritten." +
  41. "DO NOT EDIT! -->" +
  42. "<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">" +
  43. "<TITLE>Bookmarks</TITLE>" +
  44. "<H1>Bookmarks Menu</H1>" +
  45. "<DL><p>");
  46.  
  47. foreach(string link in yt_links)
  48. {
  49. sw.WriteLine(link);
  50. }
  51.  
  52. sw.WriteLine("</DL><p>" +
  53. " </DL><p>" +
  54. "</DL><p>" );
  55.  
  56.  
  57. sw.Flush();
  58. sw.Close();
  59.  
  60.  
  61. }
  62. }
  63. }

以上是关于书签编辑(过滤器链接)的主要内容,如果未能解决你的问题,请参考以下文章

javascript书签复制网页标题和链接

使用书签更改 url

访问VBA - 使用书签删除过滤器并保持当前记录

Huawei_Netconf_Ncclient

《PHP与Dreamweaver基础教程(英)David Powers_陈宗斌译-带书签 》高清pdf下载链接

《PHP与Dreamweaver基础教程(英)David Powers_陈宗斌译-带书签 》高清pdf下载链接