申请地址 [英] Application Address

查看:75
本文介绍了申请地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要获得看起来像这样的应用程序地址
http://www.mysite.com

我已经尝试过Request.FilePaht文件说它返回了

的完整路径请求包括主机名但在我的机器上有一些

因为它只返回虚拟路径而且等于RawUrl。


有什么问题?如何以编程方式获取主机名?

Shimon

Hi
I need to get application address that will look like this
http://www.mysite.com
I tried already Request.FilePaht that the documentation says that it returns
the full path of the request including host name but on my machine for some
reason it only returns virtual path and is equal RawUrl.

What''s wrong? How can I get host name programmatically?
Shimon

推荐答案

从这里开始也许

for (int i = 0; i< Request.ServerVariables.Count; i ++)

{


Response.Write(Request.ServerVariables [ i] .ToString()+"< br>");


}

-

Curt Christianson

网站&脚本: http://www.Darkfalz.com

博客: http://blog.Darkfalz.com

" Shimon Sim < ES ***** @ att.net>在消息中写道

新闻:例如**************** @ tk2msftngp13.phx.gbl ...
start here maybe
for(int i = 0;i < Request.ServerVariables.Count;i++)

{

Response.Write(Request.ServerVariables[i].ToString() + "<br>");

}
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Shimon Sim" <es*****@att.net> wrote in message
news:eg****************@tk2msftngp13.phx.gbl...

我需要获得看起来像这样的应用程序地址
http://www.mysite .com
我已经尝试过Request.FilePaht文件说它
返回请求的完整路径,包括主机名但在我的机器上
由于某种原因它只返回虚拟路径与RawUrl相等。

有什么问题?如何以编程方式获取主机名?
Shimon
Hi
I need to get application address that will look like this
http://www.mysite.com
I tried already Request.FilePaht that the documentation says that it
returns the full path of the request including host name but on my machine
for some reason it only returns virtual path and is equal RawUrl.

What''s wrong? How can I get host name programmatically?
Shimon



尝试Request.Url

" Shimon Sim" < ES ***** @ att.net> pí1vvdiskusnímp?íspìvku

新闻:例如**************** @ tk2msftngp13.phx.gbl ...
Try Request.Url
"Shimon Sim" <es*****@att.net> pí1e v diskusním p?íspìvku
news:eg****************@tk2msftngp13.phx.gbl...

我需要获得看起来像这样的应用程序地址
http:// www.mysite.com
我已经尝试过Request.FilePaht文件说它
返回请求的完整路径,包括主机名但在我的机器上
由于某种原因它只返回虚拟路径并且等于RawUrl。

有什么问题?如何以编程方式获取主机名?
Shimon
Hi
I need to get application address that will look like this
http://www.mysite.com
I tried already Request.FilePaht that the documentation says that it
returns the full path of the request including host name but on my machine
for some reason it only returns virtual path and is equal RawUrl.

What''s wrong? How can I get host name programmatically?
Shimon



如果您在虚拟目录中,它将显示,而不是基本URL

-

Curt Christianson

网站&脚本: http://www.Darkfalz.com

博客: http://blog.Darkfalz.com

"的Jakub" < JA ***** @ centrum.cz>在消息中写道

news:em **************** @ TK2MSFTNGP14.phx.gbl ...
If you are in a virtual dir it will show that, not the base URL
--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jakub" <ja*****@centrum.cz> wrote in message
news:em****************@TK2MSFTNGP14.phx.gbl...
试用请求。 Url

" Shimon Sim" < ES ***** @ att.net> pí1vvdiskusnímp?íspìvku
新闻:例如**************** @ tk2msftngp13.phx.gbl ...
Try Request.Url
"Shimon Sim" <es*****@att.net> pí1e v diskusním p?íspìvku
news:eg****************@tk2msftngp13.phx.gbl...
嗨我需要获得看起来像这样的应用程序地址
http://www.mysite。 com
我已经尝试过Request.FilePaht文件说它
返回请求的完整路径,包括主机名,但由于某种原因,它只返回我的
机器上它返回虚拟路径和等于RawUrl。

有什么问题?如何以编程方式获取主机名?
Shimon
Hi
I need to get application address that will look like this
http://www.mysite.com
I tried already Request.FilePaht that the documentation says that it
returns the full path of the request including host name but on my
machine for some reason it only returns virtual path and is equal RawUrl.

What''s wrong? How can I get host name programmatically?
Shimon




这篇关于申请地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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