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.
24 posts Page 2 of 3
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: Favicon help?
Usman55
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.
Image
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Favicon help?
comathi
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
VIP - Donator
VIP - Donator
Posts: 812
Joined: Fri Nov 05, 2010 6:24 pm

Re: Favicon help?
Vikhedgehog
Lol this is getting offtopic :lol:
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Favicon help?
comathi
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:
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Favicon help?
Codex
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
User avatar
Martin
Supreme VIP
Supreme VIP
Posts: 369
Joined: Sat Aug 01, 2009 12:26 pm

Re: Favicon help?
Martin
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 :D
Image
User avatar
dj1437
VIP - Donator
VIP - Donator
Posts: 504
Joined: Tue Dec 21, 2010 2:02 am

Re: Favicon help?
dj1437
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.
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: Favicon help?
CodenStuff
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.
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: Favicon help?
Usman55
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.
Image
User avatar
dj1437
VIP - Donator
VIP - Donator
Posts: 504
Joined: Tue Dec 21, 2010 2:02 am

Re: Favicon help?
dj1437
Cody, thanks for the code, but it didn't work! Is this compatible with
the Gecko engine?

Image
This is a signature.
24 posts Page 2 of 3
Return to “Coding Help & Support”