avatar
d*t
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.
avatar
b*e
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.

avatar
c*o
3
Great! I appreciate your help!

Let's
is
don't

【在 b*e 的大作中提到】
: you could use Server.MapPath("/")
avatar
p*y
4
that's is website root.
for virtual directory of the project, use ResolveUrl("~")

【在 b*e 的大作中提到】
: you could use Server.MapPath("/")
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。