RetrieveFavicon 获取任何站点的 favicon
生活随笔
收集整理的這篇文章主要介紹了
RetrieveFavicon 获取任何站点的 favicon
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原文發表于我的技術博客
開源了一個獲取任何站點 favicon 的類庫,供使用。
原文發表于我的技術博客
RetrieveFavicon
Project GitHub
Retrieve favicon from any website url using C#.
A part of project GuGuJianKong backend API.
Retrieve favicon type
- direct retrieve $website url/favicon.ico
- retrieve href from website content where contains <link rel="* icon" href="..." />
- retrieve href from website content where contains <link rel="apple-touch-icon" href="..." />
Usage
{% codeblock lang:csharp%}
[TestMethod]
public void CanGetFaviconIco()
{
var faviconUrl = Common.Helper.RetrieveFavicon.Favicon.RetrieveFavicon("https://github.com/parryqiu");
Debug.Print(faviconUrl);
Assert.IsTrue(faviconUrl != null);
}
{% endcodeblock %}
NuGet References
- Html Agility Pack
轉載于:https://www.cnblogs.com/parry/p/7062267.html
總結
以上是生活随笔為你收集整理的RetrieveFavicon 获取任何站点的 favicon的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oc---类方法load和initial
- 下一篇: HTTP 错误 500.19 - Int