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.
The reason it's not working is because your Gecko browser has about:blank as the url, which is not a valid one.
Try replacing the code with this:
And you need to import System.Text.RegularExpressions at the top.
(Imports System.Text.RegularExpressions)
Try replacing the code with this:
Code: Select all
I haven't tested it, but it should work.If Regex.IsMatch(Geckobrowser1.url.tostring, "(https?ftp):\/\/([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})(:\d{1,4})?([-\w\/#~:.?+=&%@~]*)/") Then
Dim iconURL = Geckobrowser1.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())
End if
And you need to import System.Text.RegularExpressions at the top.
(Imports System.Text.RegularExpressions)
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
Did you write that regex yourself? I can spot some errors
My best shot is:

My best shot is:
Code: Select all
"((http|https|ftp):\/\/)?[0-9a-zA-Z\-_]{1,63}\.([0-9a-zA-Z\-_]{1,63}\.){1,123}[0-9a-zA-Z\-_]{1,63}([:\d]{1,5})?[\/]?([\w\.-][\/]?)*
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

Was that my regex? Codex's has errors so that won't work. I have tested mine on multiple URLs and it matches all correctly. Just now I counted the ( and )'s, and there is an equal amount so that shouldn't be an error.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

Copyright Information
Copyright © Codenstuff.com 2020 - 2023