获得二级域名的方法;
public string GetSecondDomainName()
{
DataBase DB = new DataBase();
string name = "none";
name = HttpContext.Current.Request.Url.AbsoluteUri.ToLower();
int ii = name.IndexOf("localhost");
if (ii == -1)
{
name = name.Replace("http://www.", string.Empty).Replace("http://", string.Empty).Replace(".369b2b.com/membercenter/regist.aspx", string.Empty).Replace(".369b2b.com/membercenter/login.aspx", string.Empty);
if (name == "www")
{
name = "none";
}
else
{
//檢查會員是否存在
int exsits = DB.ExecuteSelectInt(" select 1 from user where Name='" + name.Trim() + "' ");
if (exsits == 0)
{
name = "err";
}
}
}
else
{
name = "none";
}
return name;
}