现在得到当前的路径,如:http://community.csdn.net/Expert/PostNew.asp?room=5202我用c#在后台怎么得到:PostNew.asp这个值??
解决方案 »
- ASP.NET邮件问题
- cookie读取密码问题?
- 我想仿照设计一个日历\周历\月历,有个问题:怎样把当前周的日期和星期排列显示出来?
- session保存datagrid中的某些行,顶有分!!……
- 关于上传图片 后格式 ,大小 发生变化的问题? 新人急问。
- 如何实现Repeat控件里面嵌套DataGrid控件?
- 请问怎样在Button中添加代码打印Image控件里面的图片?
- 菜鸟关于Forms身份认证的问题!
- 论坛中的图片技巧???
- VB.NET中(webform)控件DropDownList的使用问题<在线等>
- 请问我网页上添加的文章的字怎么都跑到页面的右侧了啊?我应该怎样改代码才能使排版正常啊?
- asp.net如何得到这个存储过程得来的值?
看
http://community.csdn.net/Expert/topic/3272/3272535.xml?temp=.6646082
不要固定了,因为还有可能是jsp,aspx等等
string[] theParms = theUrl.Split('/');
string youWant = theParms[theParms.Lengh-1];
string[] theParms = theUrl.Split('/');
string youWant = theParms[theParms.Lengh-1];
不对,没人给个正解??
string str=Page.Request.Url.ToString();
str.Substring(str.LastIndexOf("/"),str.IndexOf("?"));
str.Substring(str.LastIndexOf("/"),str.IndexOf("?"));我这么写不对呀
str.Substring(str.LastIndexOf("/")+1,str.IndexOf("?")- str.LastIndexOf("/")-1);
//string[] theParms = theUrl.Split('/');
//string youWant = theParms[theParms.Lengh-1];
string youWant1 =therul.Substring(therul.LastIndexOf("\\")+1);//PostNew.asp
string youWant2 =therul.Substring(therul.LastIndexOf(".")+1);//.asp