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 = "";
Port = ":" + Port;
string Protocol = Request.ServerVariables["SERVER_PORT_SECURE"];

if (Protocol == null || Protocol == "0")
Protocol = "http://";
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=;u=74

Anónimo dijo...

cod soma pharmacylamisil kaiser pharmacy products lamisil

[url=]buy levitra online with fast delivery[/url]

Anónimo dijo...

Enjoying reading the posts here, thanks[url=