[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1365
  • Last Modified:

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)
0
keith1001
Asked:
keith1001
1 Solution
 
rawinnlnx9Commented:
0
 
Paul JacksonSoftware EngineerCommented:
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.
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now