user2448122 user2448122 - 1 year ago 172
C# Question

dot instead of slash in c# file path

I am making my first steps with C#. Taken over a project, and wondering why does the following code work:

Stream myStream = myAssembly.GetManifestResourceStream("");

I am wondering about the dots in the file path. Why is this okay? I would expect to see something like

Stream myStream = myAssembly.GetManifestResourceStream("ConfigTool\\resources\\bg.bmp");

Which is not working. So I am puzzled.
The directory structure for the record is:


Answer Source

the file structure at your disk is the same to package structure in project/application (it defines this structure). and the app gets resources from packages (in apps logic) not from files. this is why you use dot notification not slashes.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download