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;
}

3 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...

cod soma pharmacylamisil kaiser pharmacy products lamisil

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