原文发表于我的技术博客

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


作者:Parry
出处:http://www.cnblogs.com/parry/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-09
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
猜你喜欢
  • 2021-09-28
  • 2021-12-06
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案