Link to home
Start Free TrialLog in
Avatar of keith1001
keith1001Flag for United States of America

asked on

Visual basic .net - Try Catch Ex.Exception get actual error number

I have the following below and it shows a message like
404 not found
401 not authorized

How would I just get the error number?

Catch ex As WebException
            MsgBox(ex.Message)
ASKER CERTIFIED SOLUTION
Avatar of rawinnlnx9
rawinnlnx9
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Paul Jackson
You could use the err object instead that gives err.number but I don't think you can use this in a try catch. You basically are going back to the vb6 way of error handling.