Currently I have a web project A, it has one button, and the button on-click event will call a function in another project B.
Now within this function, I have to access a file which is under project B, with path like /B/Template/myFile.doc
I have tried to use method like Server.MapPath()
and HostingEnvironment.MapPath()
in this function, but both method is getting relative path to project A rather than B
I guess indeed it is the correct behavior but how can I get the path of this file in project B successfully? Any help would be appreciated!
答案 0 :(得分:0)
One way to do it would be:
Hope that helps!