Click here to Skip to main content
15,905,427 members
Home / Discussions / C#
   

C#

 
AnswerRe: TcpClient overhead Pin
WillemM6-Oct-06 4:39
WillemM6-Oct-06 4:39 
QuestionHandling multiple keys Pin
Bekjong6-Oct-06 3:58
Bekjong6-Oct-06 3:58 
Questionhow to change tempo of midi file Pin
Amar Chaudhary6-Oct-06 3:58
Amar Chaudhary6-Oct-06 3:58 
QuestionFormatException Pin
123456uio6-Oct-06 3:45
123456uio6-Oct-06 3:45 
AnswerRe: FormatException Pin
Martin#6-Oct-06 4:03
Martin#6-Oct-06 4:03 
GeneralRe: FormatException Pin
Guffa6-Oct-06 4:54
Guffa6-Oct-06 4:54 
GeneralRe: FormatException Pin
Martin#6-Oct-06 8:20
Martin#6-Oct-06 8:20 
GeneralRe: FormatException Pin
Guffa6-Oct-06 10:21
Guffa6-Oct-06 10:21 
Martin# wrote:
So I guess you would also recommend using double.TryParse plus cast to int, instead of try catch with Convert.ToInt32.


Yes. Exceptions are mainly for unexpected situations. If you expect something to happen, you should try to stop it before it happens.

Another alternative is to use a regular expression to validate the string before you convert it. If you have verified that a string only contains digits and not more than fits in the range of an int, you can safely convert it to an int.


---
b { font-weight: normal; }

Questionhi how can use c++ program in C#.net2003 application Pin
premkamalg6-Oct-06 3:23
premkamalg6-Oct-06 3:23 
AnswerRe: hi how can use c++ program in C#.net2003 application Pin
shabonaa6-Oct-06 4:15
shabonaa6-Oct-06 4:15 
Generalhi, i want use some c++ function in C#.net2003 Pin
premkamalg6-Oct-06 17:32
premkamalg6-Oct-06 17:32 
QuestionOpen a form? Pin
Wolf926-Oct-06 3:14
Wolf926-Oct-06 3:14 
AnswerRe: Open a form? Pin
Stefan Troschuetz6-Oct-06 3:26
Stefan Troschuetz6-Oct-06 3:26 
GeneralRe: Open a form? Pin
Wolf926-Oct-06 3:33
Wolf926-Oct-06 3:33 
GeneralRe: Open a form? Pin
Stefan Troschuetz6-Oct-06 3:41
Stefan Troschuetz6-Oct-06 3:41 
GeneralRe: Open a form? Pin
shabonaa6-Oct-06 4:12
shabonaa6-Oct-06 4:12 
GeneralRe: Open a form? Pin
Wolf926-Oct-06 5:27
Wolf926-Oct-06 5:27 
QuestionRequirement Pin
Parshant Verma6-Oct-06 2:39
Parshant Verma6-Oct-06 2:39 
AnswerRe: Requirement Pin
Stefan Troschuetz6-Oct-06 3:22
Stefan Troschuetz6-Oct-06 3:22 
Questionhow to run Pin
Parshant Verma6-Oct-06 2:38
Parshant Verma6-Oct-06 2:38 
AnswerRe: how to run Pin
Stefan Troschuetz6-Oct-06 3:18
Stefan Troschuetz6-Oct-06 3:18 
QuestionConvert VBA to C# Pin
Guytz6-Oct-06 1:44
Guytz6-Oct-06 1:44 
AnswerRe: Convert VBA to C# Pin
mikone6-Oct-06 2:15
mikone6-Oct-06 2:15 
GeneralRe: Convert VBA to C# Pin
Guytz6-Oct-06 3:57
Guytz6-Oct-06 3:57 
AnswerRe: Convert VBA to C# Pin
shabonaa6-Oct-06 2:15
shabonaa6-Oct-06 2:15 

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.