简体   繁体   中英

Pass values to .ashx query string and receive response using Windows form

I am currently working on an 8 Ball application for that uses a .ashx query string on the browser to receive numbers and return responses.

As of now, i am testing the string on my browser like so....


myapp/Modules/SMS/Services/ProcessEightBall.ashx?name=Mike&Session=123&Querystring=

Hello Mike, help me tell your destiny.
Choose:
1. Tell your Fate
2. Answer a Question
3. See into the Future.


basically, one adds a parameter to the Query string in response to the Question askede.g.


myapp/Modules/SMS/Services/ProcessEightBall.ashx?name=Mike&Session=1234&Querystring=1

Dear Mike,
You Shall Meet a Funny person and have a huge pizza for Lunch.


I need help on how to make a windows Forms application that can replace the Session and the QueryString using TextBoxes, and posts the string and receive the response on a section of the screen...of the 8ball :)

Well, you can still use the HttpUtility class in Windows Forms. So you can use Uri, get the query string, use HttpUtility.ParseQueryString to get all the values, change the ones you want, build the query string again (don't forget to encode the arguments as needed) and you're done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM