How can I retrieve real time data from a website i

2019-08-28 20:37发布

问题:

I am creating a c# program that should get:
1) The current users on the web site.
2) Some basic info about those users. (Web browser, location).

How can I retrieve that data from a web site via C#?
(I thought that I could upload a php/aspx file that will save that data to a txt file, and c# will download that data and show it) - is there a more simple way of doing this? or rather a better way?

回答1:

This is a very open question there are many ways you can go about this.

Why not just add an analytics package to your site (there are many free ones out there) and then if you wanted you could write a C# program to hook into the analytics API and download the data.



回答2:

So, you can create a WebService that contains your methods in the website and add a reference for web service in your winforms application and then you can easily call methods from webservice and used it. good luck



回答3:

I think you can use WebClient Class for this. Also you can use HttpWebRequest and HttpWebResponse



标签: c# web