LinkLabel error in vista

dclus

Member
Joined
Jan 14, 2007
Messages
13
Programming Experience
5-10
Hi All,

I have a simple subroutine to open an Internet website from a form using Linklabel. It is happy as a frog in Windows XP but throws an exception error in Vista. Says;
The system cannot find the file specified.
If I close the exception dialog the website comes up fine?

VB.NET:
    Private Sub Link1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles Link1.LinkClicked
        System.Diagnostics.Process.Start("www.msn.com")
    End Sub

Has anyone come across this? Many thanks
 
I don't think it is Vista related, at least not a problem here. Is it any different if you specify the protocol explicitly? "http://url"
 
No, my Vista machine does not have SP1. Don't use Vista that much so its out of date. I will update... Thanks for bringing that up.
 
Well, I am clueless. Today it stopped throwing the exception. I went ahead and added a try/catch just in case;

VB.NET:
        Try
            System.Diagnostics.Process.Start("www.mydomain.com")
        Catch ex As Exception
            MsgBox("Problem opening Web Page", MsgBoxStyle.Critical, "Error!")
        End Try

First three work fine, last one throws nasty exception:
 
Use RegEx to check the input before sending it to the Process.Start() method, the regex will need a pattern that'll allow the first 3 to pass, but not that last one
 
Thank you JuggaloBrotha,
cool beans, never heard of that before... the link is static, not from input so I really don't have to test anything and it is going at my website...
 
Back
Top