Search code examples
c#statisticsweb-statistics

Automated statistics gathering from C# applications


I have made a C# application , now I want to create custom survey (actually sending data automatically to me, about - crashes , usage duration etc.) to enhance my application .

How can I do it ?


Solution

  • You may do this:

    1. Host a REST service at your server, the common way is to add a WebAPI controller in ASP.NET MVC project.
    2. On the client application create a System.Threading.Timer instance and set desired schedule to send the statistics. Or just send them each time user starts your application.
    3. Send statistics to your REST service using WebClient/HttpClient.

    Tutorials:

    Get Started with ASP.NET Web API 2 (C#)

    Call a Web API From a .NET Client (C#)