[thelist] Website Hacked?

Chris Anderson Chris at activeide.com
Sat May 24 17:55:54 CDT 2008


> C#:
>              try
>              {
>                  float valNumber = float.Parse(sNumber);
>                  bTruth = true;
>              }
>              catch
>              {
>                  bTruth = false;
>              }
> 

Or if you don't want to incur the cost of throwing an Exception :

	float valNumber;
	if (float.TryParse(sNumber, out valNumber)
	{
		//use valNumber as it's valid
	}
	else
	{
		//handle invalid entry
	}




More information about the thelist mailing list