Grab $_GET like in PHP but in Visual Basic? [duplicate]
Possible Duplicate:
Grab $_GET like in PHP but in Visual Basic?
I have a web browser called WebBrowser1 and I want to be able to detect the $_GET like i would be able to in PHP and place it in a Textlabel
Like if the url was:
www.thisurl.com/page.php?lol=grabthis
Is it possible to Visual Basic to grab what ever is in 'lol'. I'm a bit new at the this so please let me know. Thanks! :)
This is assuming you are running a webforms VB.net application.
First you'll need to add a reference to System.Web
Then use the following code to read the querystring from the browser uri and parse it into a collection of name value pairs. If you don't want to include System.Web you could write your own code to do it based on the value of WebBrowser1.Uri.Query
Dim queryString As String = webBrowser1.Url.Query
Dim queryStringValues As NameValueCollection = HttpUtility.ParseQueryString(queryString)
Dim lolValue As String = queryStringValues("lol")
精彩评论