书签编辑(过滤器链接)
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..
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace htmlParse { class Program { static void Main(string[] args) { //list of (html code <A> </A> for a link). string line = ""; while ( (line = sr.ReadLine()) != null ) { //.. //contains youtube link? if(line.Contains("A HREF="http://www.youtube.com/watch")) { yt_links.Add(line); } } sw.WriteLine("<!DOCTYPE NETSCAPE-Bookmark-file-1>" + "<!-- This is an automatically generated file." + " It will be read and overwritten." + "DO NOT EDIT! -->" + "<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">" + "<TITLE>Bookmarks</TITLE>" + "<H1>Bookmarks Menu</H1>" + "<DL><p>"); foreach(string link in yt_links) { sw.WriteLine(link); } sw.WriteLine("</DL><p>" + " </DL><p>" + "</DL><p>" ); sw.Flush(); sw.Close(); } } }
以上是关于书签编辑(过滤器链接)的主要内容,如果未能解决你的问题,请参考以下文章