Reputation: 339
.Net MVC. I want to load a XML file from my directory and the directory path can be random. I can load the XML file but I need also to know my file directory path. Can anybody give me the idea how can I get the full directory path of my XML file. Suppose the file is in C:\abc\test.xml
or D:\cde\test2.xml
. If I load 1st one I need the directory path as C:\abc\test.xml
in my application.
Upvotes: 0
Views: 425
Reputation: 339
Sorry for my late answer. The problem was that I did not get full directory path to read the file. Then I created a cache memory to save the file and read it. It is just like, var fileSavePath = Path.Combine(Server.MapPath("~/XMLFiles"), fileName);
Upvotes: 1