lunes, diciembre 12, 2005

[ASP.NET] URL completa donde mi applicacion web esta corriendo

Para saber la url donde mi Applicacion Web esta corriendo, uso el siguiente codigo:

public string MiUrl()
{
string Port = Request.ServerVariables["SERVER_PORT"];
if (Port == null || Port == "80" || Port == "443")
Port = "";
else
Port = ":" + Port;
string Protocol = Request.ServerVariables["SERVER_PORT_SECURE"];

if (Protocol == null || Protocol == "0")
Protocol = "http://";
else
Protocol = "https://";
string final = Protocol + Request.ServerVariables["SERVER_NAME"]
+ Port + Request.ApplicationPath;
if (final[final.Length - 1] != '/')
final += "/";
return final;
}

5 comentarios:

Anónimo dijo...
Este blog ha sido eliminado por un administrador de blog.
Anónimo dijo...

Ola, what's up amigos? :)
In first steps it is very nice if someone supports you, so hope to meet friendly and helpful people here. Let me know if I can help you.
Thanks and good luck everyone! ;)

Anónimo dijo...

thanks for adding me to the forum[url=http://theradiored.net/forum/index.php?action=profile;u=74
].[/url]

Anónimo dijo...

cod soma pharmacylamisil kaiser pharmacy products lamisil

[url=http://www.bebo.com/buylevitraonline1]buy levitra online with fast delivery[/url]

Anónimo dijo...

Enjoying reading the posts here, thanks[url=http://evo.hr/gank//profile.php?mode=viewprofile&u=67062
].[/url]