How to read GH_file in c#?

Hi all,
how can the gh_file can be read.
i tried.

GH_Document doc = new GH_Document();
string path = @"D:\Grasshopper\Grasshopper_File\";
doc.FilePath = path;
A = doc.Objects.Count;

its 0 but there are defently more objects.

GH_DocumentIO io = new GH_DocumentIO();
    GH_Document document = io.Document;
    A = document.Objects.Count;

seems to work

Thanks Baris.