URL截取网页名字
View Code
URL截取网页名字string URL= Request.Url.AbsoluteUri.Substring(Request.Url.AbsoluteUri.LastIndexOf("PF")+3);//如PF/aaaa.aspx 截取PF/后面 if (URL.IndexOf("?")!=-1) { URL= URL.Substring(0, URL.LastIndexOf("?")); //截取aaaa.aspx?id=1 截取问号之前的 }