Server.MapPath不返回远程路径名 [英] Server.MapPath does not return remote path name

查看:67
本文介绍了Server.MapPath不返回远程路径名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个web服务,它试图根据IIS中虚拟目录的配置来检索文件的文件名。

这是使用C#和.Net 2.0。虚拟目录ABC配置为\\ServerX \ sharename。

当我调用Server.MapPath("〜\ abC")时,返回的是相对于webservice的路径root,例如C:\ Localwebservice \ sharename。

这是在调试器中,不确定它在生产环境中的表现。

我也启用了ASPEnableParentPaths = TRUE。相同的结果。

如果我可以返回实际配置的路径,我将被设置。

感谢您的帮助。

里克

We have a webservice that is trying to retrieve the filename of a file based on how a virtual directory is configured in IIS.

This is using C# and .Net 2.0.  The virtual dir ABC is configured as \\ServerX\sharename.

When I call Server.MapPath( "~\ABC" ), what is returned is a path relative to the webservice root, such as C:\Localwebservice\sharename.

This is in the debugger, not sure how this will behave in a production environment.

I also enabled ASPEnableParentPaths = TRUE.  Same result.

If I could have the actual configured path returned, I will be set.

Thanks for the help.

Rick

推荐答案

你在ServerX上运行吗?
Are you running this on ServerX?


这篇关于Server.MapPath不返回远程路径名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆