C# Check if relative path is directory or guid or file
<p>Given a path (that may be relative), how am I able to check if the path is a directory, or a guid, or a file. They might not exist which is what is making it difficult for me to figure out a solution to. </p>

<p>My previous solution was to check if the path was an extension like so:</p>

<pre><code>    public bool IsDirectory(string path)
    {
        var extension = Path.GetExtension(path);

        return string.IsNullOrEmpty(extension);
    }
</code></pre>

<p>But I discovered that this path will commonly also be a path to a guid, so the above will be incorrect.</p>

<p>Is there a better way I can write a function to check all these cases?</p>