I stuck with one small thing but very confusing/tricky one. I am trying to access the file "fontawesome-webfont.ttf" in one of my C# file "Example.cs".
var GenderIcons = BaseFont.CreateFont("D:\\code\\Source\\Project\\Content\\fonts\\fontawesome\\" + "fontawesome-webfont.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
I would like to access the file using dynamic path, (..\sample.txt)
Implementation file:
D:\code\Source\Project\Extensions\Export\Example.cs
Dependency file:
D:\code\Source\Project\Content\fonts\fontawesome\" + "fontawesome-webfont.ttf"
In Example.cs, I need to go back to the folder "Project" from there I need to traverse to the fontawesome folder.
How can I change the static path to dynamic?
var GenderIcons = BaseFont.CreateFont("..\\..\\..\\Content\\fonts\\fontawesome\\" + "fontawesome-webfont.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
I am getting the following error.
Message: "..\\..\\..\\Content\\fonts\\fontawesome\\fontawesome-webfont.ttf not found as file or resource."
Any suggestions would be helpful to me.
P.S: Any useful article related to C# file handling is also appreciated