如何通过IIRF获取绝对网址 [英] How do I get the absolute url through the IIRF

查看:54
本文介绍了如何通过IIRF获取绝对网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从c#代码中获取文件的绝对URL?

路径应来自IIRF

我有路径〜/file.aspx",我想要
"http://www.mydomain.xyz/myapp/file"
使用IIRF

How do I get the absolute url for a file from c#-code?

The path should come from IIRF

I have the path "~/file.aspx" and I want
"http://www.mydomain.xyz/myapp/file"
Using IIRF

推荐答案

Server.Mappath(~/file.aspx)

将返回完整路径.


请参见以下讨论:http://www.velocityreviews.com/forums/t116455-absolute-url-from-relative-path.htm [ ^ ]
See this discussion: http://www.velocityreviews.com/forums/t116455-absolute-url-from-relative-path.htm[^]


嗨 利普萨,

你可以得到

Hi Lipsa,

You can get

HttpContext.Current.Request.ApplicationPath;




如有任何疑问,请让我知道.

请提供"投票":thumbsup:如果有帮助,请提供"接受答案",如果这是正确的答案.:rose:

谢谢,
Imdadhusen




Please do let me know, if you have any doubt.

Please provide "Vote":thumbsup: if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose:

Thanks,
Imdadhusen


这篇关于如何通过IIRF获取绝对网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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