Try:
string path = @"D:\Sam\DSC0001";
int index = path.LastIndexOf('\\');
if (index > 0)
{
string dir = path.Substring(0, index);
string file = path.Substring(index + 1);
string[] files = Directory.GetFiles(dir, file + ".*");
if (files.Length > 0)
{
foreach (string f in files)
{
Console.WriteLine(Path.GetExtension(f));
}
}
}