d****t 发帖数: 362 | 1 I want to record the transaction in a log file, which will be placed in a
subdirectory, called log, residing the same directory as my web project. Let's
say, my web project is at: "D:\Inetpub\wwwroot\projectA", and the logfile,
named log.txt, resides at "D:\Inetpub\wwwroot\projectA\log". The question is
how to get the virtual directory of a web project, such as projectA? I don't
want to hardcode this for ease of transfer to other machines. | b*e 发帖数: 3845 | 2 you could use Server.MapPath("/")
【在 d****t 的大作中提到】 : I want to record the transaction in a log file, which will be placed in a : subdirectory, called log, residing the same directory as my web project. Let's : say, my web project is at: "D:\Inetpub\wwwroot\projectA", and the logfile, : named log.txt, resides at "D:\Inetpub\wwwroot\projectA\log". The question is : how to get the virtual directory of a web project, such as projectA? I don't : want to hardcode this for ease of transfer to other machines.
| c*o 发帖数: 70 | 3 Great! I appreciate your help!
Let's
is
don't
【在 b*e 的大作中提到】 : you could use Server.MapPath("/")
| p***y 发帖数: 79 | 4 that's is website root.
for virtual directory of the project, use ResolveUrl("~")
【在 b*e 的大作中提到】 : you could use Server.MapPath("/")
|
|