从网址获取最后一个值
大家好,
即时通讯从url
检索最后一个值
例如:
const string str ="http://www.codeproject.com/Questions/ask.aspx"
这是恒定的
我的应用程序自动将所有字符串或数字添加为
http://www.codeproject.com/Questions/ask.aspx sadfsf_sdf
http://www.codeproject.com/Questions/ask.aspx skdfwer234
现在我想从url中获取值,添加的新值是什么
结果是= sadfst_sdf
result2是= skdfwer234
像这样
不知道如果有人帮助我,我该怎么办
非常适合
谢谢你.
Hi all,
im retrieve last value from url
example:
const string str="http://www.codeproject.com/Questions/ask.aspx"
this is constant
im my application automaticall added string or number like
http://www.codeproject.com/Questions/ask.aspxsadfsf_sdf
http://www.codeproject.com/Questions/ask.aspxskdfwer234
Now i want to get the value from url what is the new value added
result is=sadfst_sdf
result2 is=skdfwer234
like this
don''t know how can i get like that if any one help me out
greatly appriciate
Thank U.
测试一下.
Test this one.
String test = "http://www.codeproject.com/Questions/ask.aspxsadfsf_sdf";
test = test.Substring(test.IndexOf("aspx"));
字符串strs = last.Substring(last.LastIndexOf("http://test.com/ws/test/v10")+ 28);
Console.Write(strs.ToString());
这也很好用.
string strs = last.Substring(last.LastIndexOf("http://test.com/ws/test/v10") + 28);
Console.Write(strs.ToString());
this is also working fine.