现在得到当前的路径,如:http://community.csdn.net/Expert/PostNew.asp?room=5202我用c#在后台怎么得到:PostNew.asp这个值??
解决方案 »
- 仿Gmail的网页聊天实现思路,用数据库的就免了
- 请帮我看看这段代码的问题在哪里,谢谢
- 一个简单程序问题和一个空间域名问题
- 请教:用ASP.NET(C#)+Sql Server2000 开发一个交互平台(社区类型的站)
- 男女单选按纽问题、、、、
- 我建了一个QQ群 关于.NET技术交流的 欢迎大家加入
- 请教:从中文微软公司下载了SDK,但运行asp.net程序出错时显示英文信息,怎么办呢?
- .net倒计时
- ASP.NET开发的WEB页面不能显示大的FLASH文件?!!高手HELP~在线等
- 我想在.vb代码中使用response对象,这样做为什么错?
- 请问我网页上添加的文章的字怎么都跑到页面的右侧了啊?我应该怎样改代码才能使排版正常啊?
- 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