In C#, Whenever i need to get file path more dyanmically, i do something like this
string filePath = System.IO.Path.GetFullPath(@"..\..\TestData\TestFile.xls");
Is there anyway, i can mention same file path in xml file.
<ConfigValue name ="filePath" value="<filepath like above>"/>
You can add this to your app/web.config:
And read the value like so:
You need to add a using statement to the top of your file:
And for that to work you need to add a reference to the
System.Configurationassembly in your project.