Click here to Skip to main content
15,916,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: C#, How to check an object to see if it is a numeric value? Pin
dan!sh 7-Apr-08 18:53
professional dan!sh 7-Apr-08 18:53 
GeneralRe: C#, How to check an object to see if it is a numeric value? Pin
Christian Graus7-Apr-08 19:15
protectorChristian Graus7-Apr-08 19:15 
GeneralRe: C#, How to check an object to see if it is a numeric value? Pin
Jeeva Jose7-Apr-08 20:14
Jeeva Jose7-Apr-08 20:14 
GeneralRe: C#, How to check an object to see if it is a numeric value? Pin
Christian Graus7-Apr-08 20:19
protectorChristian Graus7-Apr-08 20:19 
GeneralRe: C#, How to check an object to see if it is a numeric value? Pin
Mircea Puiu7-Apr-08 21:33
Mircea Puiu7-Apr-08 21:33 
GeneralRe: C#, How to check an object to see if it is a numeric value? Pin
blackjack21507-Apr-08 23:51
blackjack21507-Apr-08 23:51 
GeneralRe: C#, How to check an object to see if it is a numeric value? Pin
Mircea Puiu8-Apr-08 21:19
Mircea Puiu8-Apr-08 21:19 
GeneralWell, there is a simpler way... Pin
Anthony Mushrow7-Apr-08 21:59
professionalAnthony Mushrow7-Apr-08 21:59 
Assuming you had something like:
int number = 5;
...
object obj = number;

or
object obj = 5;

Then you could just use:
if(obj.GetType() == typeof(Int32) {
    //We have an int
}

or even simpler still:
if(obj is Int32)
    //Omg, an int

You may also want to check for Int16 and Int64 (or you can check for short, int and long, oh yeah and there's also float and double to check for as well. And the unsigned versions of the types)

My current favourite word is: Nipple!
-SK Genius


QuestionHow to interrupt a method in c#? Pin
daniel abcde7-Apr-08 16:17
daniel abcde7-Apr-08 16:17 
AnswerRe: How to interrupt a method in c#? Pin
daniel abcde7-Apr-08 16:21
daniel abcde7-Apr-08 16:21 
GeneralRe: How to interrupt a method in c#? Pin
Luc Pattyn7-Apr-08 17:21
sitebuilderLuc Pattyn7-Apr-08 17:21 
GeneralRe: How to interrupt a method in c#? Pin
daniel abcde7-Apr-08 21:30
daniel abcde7-Apr-08 21:30 
GeneralRe: How to interrupt a method in c#? Pin
Mircea Puiu7-Apr-08 21:55
Mircea Puiu7-Apr-08 21:55 
GeneralRe: How to interrupt a method in c#? Pin
scott_hackett9-Apr-08 2:53
scott_hackett9-Apr-08 2:53 
GeneralRe: How to interrupt a method in c#? Pin
Mircea Puiu10-Apr-08 21:29
Mircea Puiu10-Apr-08 21:29 
GeneralRe: How to interrupt a method in c#? Pin
daniel abcde14-Apr-08 0:04
daniel abcde14-Apr-08 0:04 
GeneralRe: How to interrupt a method in c#? Pin
Mircea Puiu14-Apr-08 23:27
Mircea Puiu14-Apr-08 23:27 
QuestionValidate user permissions Pin
Thedan7-Apr-08 15:40
Thedan7-Apr-08 15:40 
GeneralRe: Validate user permissions Pin
daniel abcde7-Apr-08 17:08
daniel abcde7-Apr-08 17:08 
QuestionAppDomain with System.Reflection.Assembly? Pin
Daniel Grondin7-Apr-08 15:31
Daniel Grondin7-Apr-08 15:31 
AnswerRe: AppDomain with System.Reflection.Assembly? Pin
Luc Pattyn7-Apr-08 15:36
sitebuilderLuc Pattyn7-Apr-08 15:36 
Generalproblem with HttpRequest.QueryString Pin
dfn7-Apr-08 12:44
dfn7-Apr-08 12:44 
GeneralRe: problem with HttpRequest.QueryString Pin
Christian Graus7-Apr-08 12:54
protectorChristian Graus7-Apr-08 12:54 
GeneralRe: problem with HttpRequest.QueryString Pin
Guffa7-Apr-08 13:59
Guffa7-Apr-08 13:59 
GeneralOpening files in a secure location Pin
RussBus7-Apr-08 11:40
RussBus7-Apr-08 11:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.