日期:2014-05-17 浏览次数:20376 次
<SCRIPT>
function ch_url()
{
var d_url=document.location.href;
//var d_url1=d_url.split(".com")[0]+".com/";
//var d_url2=d_url.split("UserNameID=")[1];
//var d_url=d_url1+d_url2;
//window.open(d_url);
}
</SCRIPT>
string url=HttpContext.Current.Request.Url.Host;
string regStr = @"([^.]+\.)?[^.]+\.(com
------解决方案--------------------
net
------解决方案--------------------
cn
------解决方案--------------------
cc
------解决方案--------------------
org
------解决方案--------------------
com\.cn)+$";
string domain = string.Empty;
string url = Request.Url.Authority;
if (Regex.IsMatch(url, regStr))
domain = Regex.Match(url, regStr).Value;