开发者

How can I give orders to a C# windows application from a website programmed in ASP 3.0

开发者 https://www.devze.com 2023-03-13 03:34 出处:网络
At first look, my question may seem a bit vague. But I\'ll try to explain it. I am profession in ASP 3.0 programming language and designed a website using ASP 3.0. But I want to build a windows applic

At first look, my question may seem a bit vague. But I'll try to explain it. I am profession in ASP 3.0 programming language and designed a website using ASP 3.0. But I want to build a windows application in C# that checks some data from my website. Unfortunately, I'm a beginner in C# programming and I can't do this job!

In a windows application(programmed in C#), the user must enter a number. This number must be sent to a webpage on my websi开发者_开发知识库te(and this is my problem). That page connects to the MS Access database (.mdb) and checks the number in database. if that number exists, the windows application user sees a "Granted" message on screen, otherwise another message will appear.

The .asp webpage can be a GET or anything else. Because I'm a beginner in C#, Please explain in a way I can understand. I really appreciate your answers. Iman


Use a web service. The web application takes a parameter via HTTP GET, and returns a simple web page that indicates whether the number is in the database or not. Then your C# application checks that web page using an WebRequest object. See here for documentation on how to use WebRequest.


For a simple web request from your C# windows application you'll want to use the WebClient class. Set up an instance of the class and call a method on the instance (probably DownloadString) to make a request to your web application and get the response as a string.

Of course, you'll need to create a handler in your web application that accepts numbers and returns strings, but since you're proficient in ASP you should be able to do that.

0

精彩评论

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