bool ValidFile(string path) { try { string fullPath = Path.GetFullPath (path); return fullPath.StartsWith (rootedPath); } catch { return false; } }