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.
Hey guys,
I was recently working on Webquest, and I was wondering, when the browser finishes loading the document, how would i be able to make the websites favicon become the forms icon? Thanks!
I was recently working on Webquest, and I was wondering, when the browser finishes loading the document, how would i be able to make the websites favicon become the forms icon? Thanks!
This is a signature.
You could try the getelemenetbyid functoin? I dont know much about this really but give it a try.
Practice makes perfect!
VIP since: 6-10-2011
VIP since: 6-10-2011
You might be able to tweak this a bit:
Code: Select all
Taken from http://social.msdn.microsoft.com/Forums ... 12b1cbc317 Dim iconURL = "http://www.microsoft.com/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 mimage = Image.FromStream(stream)
Me.ToolStripLabel1.Image = mimage
A bit tweaked version of Comathi :P
Code: Select all
Dim iconURL = "http://" + txtURL.Text +"/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 mimage = Image.FromStream(stream)
Me.PictureBox1.Image = mimage
Instead of LOL use this -
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
I have used those codes provided, but I still cant find out how to fix my problem. Please help!!! :(
This is a signature.
Tell us how the text is displayed in your textbox. I'd send you the working code but I'm not on my computer now.
Code: Select all
this should workDim 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 mimage = Image.FromStream(stream)
Me.PictureBox1.Image = mimage
A bit tweaked version of Skillful :P
Code: Select all
Dim iconURL = "http://" + txtURL.Text +"/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 mimage = Image.FromStream(stream)
Me.PictureBox1.Image = mimage
Msgbox("Done")
A bit tweaked version of Martin :P
Code: Select all
Dim iconURL = "http://" + txtURL.Text +"/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 mimage = Image.FromStream(stream)
Me.PictureBox1.Image = mimage
Msgbox("Done! Yay!")
A bit tweaked version of Vikhedgehog'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")
Copyright Information
Copyright © Codenstuff.com 2020 - 2023