请帮我翻译成c#.net
Public Property Let QueryString(ByVal args)
Dim oRe
If args <> "" Then
Set oRe = new RegExp
oRe.IgnoreCase =True
oRe.Global = True
oRe.Pattern = "CurPage=(\d*)"
args = oRe.Replace(args,"")
Set oRe = Nothing
End If
If (args <> "") And (Left(args,1) <> "&") Then
args = "&" & args
End If
sQueryString = args
End Property '这是一段ASP程序
或者请帮我写一段.net的代码
例:
thisurl="http://www.xx.com/ss.aspx?CurPage=399&id=31&cname=wz"
我只要“id=31&cname=wz”这部分
也就是说 要的是问号后面的除了"CurPage=(\d*)"的所有参数
[解决办法]
简单说一下
string thisurl = @"http://www.xx.com/ss.aspx?CurPage=399&id=31&cname=wz"; string[] para = thisurl.Split(new Char[] { '?' })[1].Split(new Char[] { '&' }); //para[0]="CurPage=399" this.textBox1.Text=para[1];//="id=31" //para[2]="cname=wz" //para[1].Split(new Char[] { '=' })[0] ="id" //para[1].Split(new Char[] { '=' })[1] ="31" //para[2].Split(new Char[] { '=' })[0] ="cname" //para[2].Split(new Char[] { '=' })[1] ="wz" //这里,键和值都得到了