天天看点

RetrieveFavicon 获取任何站点的 faviconRetrieveFaviconRetrieve favicon typeUsageNuGet References

原文发表于我的技术博客
RetrieveFavicon 获取任何站点的 faviconRetrieveFaviconRetrieve favicon typeUsageNuGet References

开源了一个获取任何站点 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="..." />

  • href

    <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/

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