开发者

DotNet :- How to send and get data between windows form app and web site?

I want to develop an app which can s开发者_运维知识库end and receive data from a website. to be precise i want to make a windows form app of a website now.


Do you have control over the web site?

  • Yes: Create some kind of Web Service API with which applications can integrate. Be it SOAP or WCF or anything, the idea is to provide the functionality without all that messy UI that applications don't need. Then your application would just access the web service API.
  • No: You can perhaps take a "screen scraping" approach, though it's a good deal messier. You'd create HttpWebRequest objects which set GET/POST requests to the page(s) in question and read the response. This can get particularly ugly if the page has a lot of dynamic content because you're just going to get the page source, not the browser-rendered output. Other requests may need to be sent for additional content.


You can form a WebRequest in your windows form app and then use some form of web service/WCF endpoint to then send data back and forth; an example is on this page.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜