Favicon help?
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Spam?
Anyways, I think the problem you're having is that when you use that code, it adds two 'http://' to the link which makes it useless. Try tweaking the code yourself according to your needs depending on how you show the web address in the textbox.
Anyways, I think the problem you're having is that when you use that code, it adds two 'http://' to the link which makes it useless. Try tweaking the code yourself according to your needs depending on how you show the web address in the textbox.
Tweaked version of Download's
Code: Select all
Dim iconURL = webbrowser1.url.tostring & "/favicon.ico"
Dim request As System.Net.WebRequest = System.Net.HttpWebRequest.Create(iconURL)
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim stream As System.IO.Stream = response.GetResponseStream()
Dim iconimage = Image.FromStream(stream)
PictureBox1.Image = iconimage
Msgbox("Loading Done")
Vikhedgehog wrote:Lol this is getting offtopic :lol:Well, not really, considering we're improving eachother's code, which itself is related to the topic :lol:
Why would you need a messagebox at the end to tell its done when you can see that in the picturebox when the icon has loaded :?
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
Codex wrote:Why would you need a messagebox at the end to tell its done when you can see that in the picturebox when the icon has loaded :?You need to be 100% sure thats its done

You people don't under stand what I am asking for. I am asking to make the FORM'S icon to be the favicon. There is no picturebox included anywhere.
This is a signature.
Yes this code works:
Code: Select all
Dim iconURL = WebBrowser1.Url.ToString & "/favicon.ico"
Dim request As System.Net.WebRequest = System.Net.HttpWebRequest.Create(iconURL)
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim stream As System.IO.Stream = response.GetResponseStream()
Dim iconimage As Bitmap = Image.FromStream(stream)
Me.Icon = Icon.FromHandle(iconimage.GetHicon())
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Yeah, codenstuff. The other codes didn't work because they doubled the 'http://' in the address bar which made the code useless. I guess I mentioned that before but got no reply, lol.
This is a signature.
Copyright Information
Copyright © Codenstuff.com 2020 - 2023