Click here to Skip to main content
15,908,675 members
Home / Discussions / C#
   

C#

 
AnswerRe: Image Resizing in a Picture box using c# Pin
Martin#5-Sep-05 8:41
Martin#5-Sep-05 8:41 
QuestionTIFF file with included color schema Pin
yarns5-Sep-05 0:52
yarns5-Sep-05 0:52 
QuestionImporting a DLL at runtime Pin
totig4-Sep-05 23:09
totig4-Sep-05 23:09 
AnswerRe: Importing a DLL at runtime Pin
totig4-Sep-05 23:52
totig4-Sep-05 23:52 
GeneralRe: Importing a DLL at runtime Pin
mav.northwind5-Sep-05 2:17
mav.northwind5-Sep-05 2:17 
GeneralRe: Importing a DLL at runtime Pin
totig5-Sep-05 2:25
totig5-Sep-05 2:25 
GeneralRe: Importing a DLL at runtime Pin
mav.northwind5-Sep-05 10:26
mav.northwind5-Sep-05 10:26 
AnswerRe: Importing a DLL at runtime Pin
Luis Alonso Ramos5-Sep-05 7:26
Luis Alonso Ramos5-Sep-05 7:26 
QuestionHow to find inner length (number of cols) in a rectangular array? Pin
signbit4-Sep-05 22:46
signbit4-Sep-05 22:46 
AnswerRe: How to find inner length (number of cols) in a rectangular array? Pin
Guffa4-Sep-05 22:53
Guffa4-Sep-05 22:53 
AnswerRe: How to find inner length (number of cols) in a rectangular array? Pin
Andrew Kirillov4-Sep-05 22:56
Andrew Kirillov4-Sep-05 22:56 
GeneralRe: How to find inner length (number of cols) in a rectangular array? Pin
signbit4-Sep-05 23:00
signbit4-Sep-05 23:00 
QuestionCrystal Report Pin
| Muhammad Waqas Butt |4-Sep-05 22:27
professional| Muhammad Waqas Butt |4-Sep-05 22:27 
QuestionMulti Line TextBox for Addresses Pin
Greeky4-Sep-05 22:19
Greeky4-Sep-05 22:19 
AnswerRe: Multi Line TextBox for Addresses Pin
philip_cole4-Sep-05 23:21
philip_cole4-Sep-05 23:21 
GeneralRe: Multi Line TextBox for Addresses Pin
Greeky4-Sep-05 23:26
Greeky4-Sep-05 23:26 
Question[Message Deleted] Pin
bruno cortona4-Sep-05 22:14
bruno cortona4-Sep-05 22:14 
AnswerRe: VS .NET 2003 hangs on NullReferenceException Pin
Andy Brummer5-Sep-05 4:22
sitebuilderAndy Brummer5-Sep-05 4:22 
GeneralRe: VS .NET 2003 hangs on NullReferenceException Pin
bruno cortona5-Sep-05 5:22
bruno cortona5-Sep-05 5:22 
Questionunsafe code Pin
Sheel Gohe4-Sep-05 22:00
Sheel Gohe4-Sep-05 22:00 
QuestionC# DLL in VC++ / MFC Pin
Anonymous4-Sep-05 21:40
Anonymous4-Sep-05 21:40 
AnswerRe: C# DLL in VC++ / MFC Pin
Anonymous5-Sep-05 2:24
Anonymous5-Sep-05 2:24 
Questiondetermining if a string contains an int Pin
Tyrus1824-Sep-05 21:04
Tyrus1824-Sep-05 21:04 
AnswerRe: determining if a string contains an int Pin
Guffa4-Sep-05 21:16
Guffa4-Sep-05 21:16 
The easiest way is to put a try...catch around the conversion:

try {
	num = int.Parse(str);
	ok = true;
} catch {
	ok = false;
}


Exceptions are quite expensive, though, so it's more efficient to validate the string before you convert it. You can use the Regex class to check if the string only contains digits, for an example.

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

AnswerRe: determining if a string contains an int Pin
Alsvha4-Sep-05 21:17
Alsvha4-Sep-05 21:17 

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.