我可以通过getid=Int32.Parse(Request["MerchtID"].ToString());得到网页相关的信息,但如果域名是
http://localhost/bill/tom/index.aspx,其中tom是一个文件夹,我应该用什么语句得到数据库中与tom
关联的信息,请教一下高手
不是很明白.不过得到URL可以这样:
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
string str,str1,str2;
str=Request.Url.Authority.ToString();
str1=Request.Url.AbsolutePath.ToString();
str2=Request.Url.AbsoluteUri.ToString();
Response.Write("Authority="+str);
Response.Write("<br/>absolutepath="+str1);
Response.Write("<br/>absoluteuri="+str2);
}
结果
Authority=localhost
absolutepath=/test/WebForm1.aspx
absoluteuri=http://localhost/test/WebForm1.aspx
这样可以根据所得来做其它了
域名转换成IPAdress用.net的 System.Net类