C
C#17mo ago
ByGoalZ

❔ Get website icons from URL

Hey, so I'm currently learning C# (i have coded in other languages already) and for my first project I wanted to make a password manager. I already kind of planned how it should work but I thought of a cool idea. In a password manager you give the website (i.e. twitter.com) and your password (then it will be saved to a text file). What I want to do is to automatically get the icon of that website (if possible) and add it on an imagelabel (im using windows forms in visual studio). Would that even work, and if yes, how? It may be too advanced as a beginner but I like learning like that.
11 Replies
Pobiega
Pobiega17mo ago
there is a convention for those icons, they are called favicon the most common thing is to just serve it at your root level under favicon.ico, but you can read the HTML to find the one used if its not there <link rel="icon" type="image/x-icon" href="/images/favicon.ico"> as an example: https://twitter.com/favicon.ico
ByGoalZ
ByGoalZOP17mo ago
Thank you! Is there a good documentation on how to implement those icons?
Pobiega
Pobiega17mo ago
what do you mean by that? You have not mentioned anything about your program, so I don't know if its a blazor, MAUI, WPF, Avalonia, Winforms, console app etc.. and "implement" how?
Florian Voß
Florian Voß17mo ago
the word implement leads us to believe you wanna create the icon yourself. You probably mean how to add an existing icon as favicon on your website?? answer what you're using from here @ByGoalZ
Angius
Angius17mo ago
https://www.google.com/s2/favicons?domain=[the-domain] lets you get favicons from Google cache
Angius
Angius17mo ago
And so on
ByGoalZ
ByGoalZOP17mo ago
I did mention windowsforms I meant like implementing the url in the code
Pobiega
Pobiega17mo ago
that still doesnt actually mean anything
Accord
Accord17mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?