Question Error handling

vishu56

New member
Joined
Aug 22, 2011
Messages
3
Programming Experience
Beginner
Hello friends.

I am trying to create an application which automatically installs my software's with the click of a command button. I am using windows 7.

the code i used is

Private Sub cmddfx_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmddfx.Click
Process.Start("G:\Softwares\DFX Audio Enhancer\DFX FOR ME!\cr-x2301\dfxSetup-WMP.exe")
End Sub

Now here, as you people might know, when i click the button, the UAC in win 7 asks for YES or NO. When i click YES everything is fine. But when i click NO, i get an error message as

Operation cancelled by the user.

Can anyone please tell me how to handle this error.

Thanks
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,545
Location
Norway
Programming Experience
10+
If you mean an exception from your app you can Try-Catch that.
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,545
Location
Norway
Programming Experience
10+

jgat2011

Member
Joined
Jul 2, 2011
Messages
13
Location
Nairobi-Kenya
Programming Experience
1-3
this is the syntax of a try catch in vb.net
VB.NET:
try
'This is where you put the codes that are likely to throw an exception

catch ex as Exception

'This is where you handle your error
'You can choose to display a message or do nothing

End try
.


Hope it helps
 
Top Bottom