winforms 应用程序的轻量级仪表

发布于 2024-07-08 07:42:38 字数 138 浏览 7 评论 0原文

我有一个 winforms 应用程序,我想跟踪用户每次单击某些按钮等以及其他操作的时间。 对我来说,跟踪这些信息并将其放在一起的最佳方法是什么,以便我可以对最常用的功能等运行指标。

这是一个 winforms 应用程序,我在世界各地都有用户。

I have a winforms app and i want to keep track of every time a user clicks certain buttons, etc as well as other actions. What is the best way for me to keep track of this information and then put it together so i can run metrics on most used features, etc.

This is a winforms app and I have users around the world.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

怀中猫帐中妖 2024-07-15 07:42:38

您的设计必须确保解决两个大问题

  1. 隐私(Don 提到的) - 您必须非常清楚您正在收集哪些信息并将其发送到中央服务器,理想情况下用户应该能够检查您发送回中央服务器的确切数据(如果他们愿意) - 对于任何公共软件都应该有一个非常简单的方法来选择退出。

  2. 性能和可扩展性 - 您必须估计服务器端真正需要多少数据,并查看聚合和压缩客户端数据的各种技巧(并对您将要访问的流量进行严格限制)正在发送以及发送的频率)

至于客户端实现,我建议调查 Sqlite.net 或其他嵌入式数据库。 使用嵌入式数据库在客户端上存储这些信息将为您提供聚合方面的很大灵活性,并且具有事务性、快速且易于实施的优势。 Sqlite 拥有非常慷慨的公共领域许可证,因此从法律角度来看,它在公共应用程序中非常容易使用。

There are 2 big issues your design has to be sure to address

  1. Privacy (what Don alluded to) - You must be crystal clear what information you are collecting and sending up to your central server, ideally the users should be able to inspect the exact data you are sending back to the central server (if they wish to) - For any public software there should be a very easy way to opt out.

  2. Performance and Scalability - You have to estimate how much data you really need on the server side and look at all sort of tricks that aggregate and compress the data client side (as well as have hard limits on the amount of traffic you will be sending and how often you will be sending it)

As to the client side implementation, I would recommend investigating Sqlite.net or another embedded DB. Using an embedded DB to store this information on the client will give you lots of flexibility with aggregations and will have the advantage of being transactional, fast and simple to implement. Sqlite has a very generous public domain license so from a legal perspective its really easy to use in public apps.

南…巷孤猫 2024-07-15 07:42:38

尝试进行谷歌学术搜索。 Ben Liblit 和合著者提出了一些有趣的想法,Alex Orso 和合著者提出了另一系列想法(免责声明 - 我是 Alex Orso 的合著者之一),这些想法基于从每个用户获取运行时信息样本,并以一种有趣的方式将它们组合在一起。

http://theory.stanford.edu/~aiken/publications/papers/ pldi03b.pdf

http://www.pldi03b.pdf cs.umd.edu/class/fall2006/cmsc838p/Ramss/remoteClassJournal.pdf

是此类论文/想法的两个(不一定是最好的)示例。

Try doing a google scholar search. There are some interesting ideas by Ben Liblit and co-authors, and another series of ideas by Alex Orso and co-authors (disclaimer - I'm one of Alex Orso's co-authors) based on taking a sample of runtime information from each user, and putting it together in an interesting way.

http://theory.stanford.edu/~aiken/publications/papers/pldi03b.pdf

and

http://www.cs.umd.edu/class/fall2006/cmsc838p/Ramss/remoteClassJournal.pdf

are two (not necessarily the best) examples of such papers/ideas.

可是我不能没有你 2024-07-15 07:42:38

我会尝试这样的事情:

    // execute this method once all forms have been created
    public static void HookButtons()
    {
         foreach( Form f in Application.OpenForms )
         {
              EnumerateControls( f.Controls );
         }
    }

    public static void EnumerateControls( ICollection controls )
    {
        foreach( Control ctrl in controls )
        {
            if( ctrl.Controls.Count > 0 )
            {
                EnumerateControls( ctrl.Controls );
            }

            if( ctrl is ButtonBase )
            {
                ctrl.MouseClick +=new MouseEventHandler( ctrl_MouseClick );
            }
        }

    }

    static void ctrl_MouseClick( object sender, MouseEventArgs e )
    {
        ButtonBase clicked = ((ButtonBase)sender);

        // do something with the click information here
    }

I'd try something like this:

    // execute this method once all forms have been created
    public static void HookButtons()
    {
         foreach( Form f in Application.OpenForms )
         {
              EnumerateControls( f.Controls );
         }
    }

    public static void EnumerateControls( ICollection controls )
    {
        foreach( Control ctrl in controls )
        {
            if( ctrl.Controls.Count > 0 )
            {
                EnumerateControls( ctrl.Controls );
            }

            if( ctrl is ButtonBase )
            {
                ctrl.MouseClick +=new MouseEventHandler( ctrl_MouseClick );
            }
        }

    }

    static void ctrl_MouseClick( object sender, MouseEventArgs e )
    {
        ButtonBase clicked = ((ButtonBase)sender);

        // do something with the click information here
    }
不知在何时 2024-07-15 07:42:38

小心你如何处理这件事。 一些公司因收集过多信息或不清楚收集的内容而遭到用户强烈反对。 最安全的方法是在启用任何“电话主页”功能之前询问用户。 允许用户在发送之前查看实际数据似乎也不错。

我想知道是否有某种方法可以搭载一键式应用程序启动并检查更新时发生的一键式部署调用。 不过我还没有调查过。

至于收集实际数字,也许用户设置是最简单的地方。 如果您不熟悉它们,只需查看项目属性并转到“设置”选项卡。

Be careful how you handle this. Some companies have gotten user backlash from collecting too much information or not being clear what was collected. The safest way is to ask the user before enabling any "phone home" features. Allowing the user to see the actual data before you send it seems good, too.

I've wondered if there's some way to piggyback on the one-click deployment call that happens whenever a one-click app starts up and checks for updates. I haven't investigated yet, though.

As for collecting the actual numbers, perhaps the user settings are the easiest place. If you're not familiar with them, just check out the project properties and go to the Settings tab.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文