|M| 如何获得当前网站的域名
谢谢
------解决方案--------------------Request.Url.Host
------解决方案--------------------Mark
------解决方案--------------------哇,这个问题就100分。楼主大方,给点分。谢谢。
------解决方案--------------------System.IO.Path.GetDirectoryName(Request.Url.AbsoluteUri)
------解决方案--------------------上面的方法能得到虚拟目录站点名称吗?
或者可以Request.Url.AbsoluteUri后spilt '/ '自己拼字符串识别
------解决方案--------------------HttpContext.Current.Request.Url.Host.ToString()
------解决方案--------------------//取得服务器相关信息
Server_sName.Text = Server.MachineName;
Server_Ip.Text = Request.ServerVariables[ "LOCAL_ADDR "];
Server_Name.Text = Request.ServerVariables[ "SERVER_NAME "];
char[] de = { '; ' };
string allhttp = Request.ServerVariables[ "HTTP_USER_AGENT "].ToString();
string[] myFilename = allhttp.Split(de);
Server_IIS.Text = myFilename[myFilename.Length - 1].Replace( ") ", " ");
Server_OS.Text = myFilename[2];
Server_Browser.Text = myFilename[1];
Server_DotNet.Text = Request.ServerVariables[ "SERVER_SOFTWARE "];
Server_Port.Text = Request.ServerVariables[ "SERVER_PORT "];
Server_ScriptTimeOut.Text = Server.ScriptTimeout.ToString();
Server_language.Text = Request.ServerVariables[ "HTTP_ACCEPT_LANGUAGE "];
Server_Time.Text = DateTime.Now.ToString();
Server_Path.Text = Request.ServerVariables[ "APPL_PHYSICAL_PATH "];
Server_FilePath.Text = Request.ServerVariables[ "PATH_TRANSLATED "];
Server_Https.Text = Request.ServerVariables[ "HTTPS "];
------解决方案--------------------System.Net.Dns.GetHostName