0

Ok, I've been bugging with this for too long.

I need to call my website from a rough VB.net app. Then only thing I need is to attach a query string parameter to the calling url, so I can distinguish the pages to be shown to different VB app users.

So I want to click a button and launch that website, giving this parameter.

First I was bugging with adding the system.web libraries. Now I can't use Request/Response.QueryString as well.

I tried getting some example help from this post. but as I said before - I cannot make use of Request.QueryString as I cannot import it. I am stuck here:

Process.Start("http://localhost:56093/WebSite1?id=")

I need to attach a query string parameter to the url and then open the website with that url. Can someone just give me a sample code for my problem.

Community
  • 1
  • 1
Syspect
  • 921
  • 7
  • 22
  • 50

1 Answers1

3

Query parameters are parsed by the web server/http handler off the URL you use to call the page. They consist of key and value pairs that come at the end of the URL. Your code is nearly there. Say you needed to pass through the parameters:

ID = 1234
Page = 2
Display = Portrait

Then you'd turn them into a URL like this:

http://localhost:56093/WebSite1?ID=1234&Page=2&Display=Portrait

Therefore in your code you'd have:

Process.Start("http://localhost:56093/WebSite1?ID=1234&Page=2&Display=Portrait");
Adrian
  • 2,825
  • 1
  • 22
  • 32