Solved

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

Posted on 2011-03-04
2
1,021 Views
Last Modified: 2012-05-11
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
Comment
Question by:keith1001
2 Comments
 
LVL 9

Accepted Solution

by:
rawinnlnx9 earned 500 total points
ID: 35038602
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35038676
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with exporting to excel 4 36
VB.NET 2008 Publish Error 2 34
Generate Numbers in JQuery file 11 66
get combo value in class 5 14
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question