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
 
If you mean an exception from your app you can Try-Catch that.
 
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
 
Back
Top