开发者

Get value from string formed as URL in ASP.NET

Ok, I have a string of the form

string temp = "http://www.example.com?file=666111&submitter=Betty&origin=Office&telNo=05555";

what I need to do is extract the value of the file variable in order to use it. If this was the referrer url I could've done Request.QueryString and got it but the problem is that I have it as a string variable.

I could try to do substring and get the value but I was hoping there was a cleaner way t开发者_运维技巧o do this?


Perhaps you can use the HttpUtility.ParseQueryString method. It returns a NameValueCollection with all parameters.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜