Search This Blog

Showing posts with label C# Tips. Show all posts
Showing posts with label C# Tips. Show all posts

Monday, March 1, 2010

Get file name from path

I cannot remember this....

 System.IO.Path.GetFileName(filepath)

its IO.Path not IO.Directory or IO.File

Saturday, October 3, 2009

Determine object type at runtime

from: http://en.csharp-online.net/CSharp_FAQ:_How_check_the_object_type_at_runtime
static bool isInteger (object o)

if (o is int || o is long)
{
return true;
}
else
{
return false;
}