获取过去几个小时/天/周的所有签到

发布于 2025-01-06 12:01:31 字数 119 浏览 2 评论 0原文

我想要一份团队项目最近几小时、几天、几周的签到列表。这可以通过 TFS SDK(以编程方式!!)吗?我该怎么做?

根据这些信息,我想根据最后一天的签到数量进行一些统计,例如项目活动。

谢谢你!

I would like to have a list of the check ins of a teamproject from the last hours, day(s), week(s), .... Is this possible through the TFS SDK (programmatically!!)? How can I do this?

From this information, I would like to make some statistics like the project activity, based on the number of checkins of the last day for example.

Thank you!

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

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

发布评论

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

评论(1

恰似旧人归 2025-01-13 12:01:31

我自己找到了解决方案。也许有人可以使用它:

TfsTeamProjectCollection tfsTeamCol = new TfsTeamProjectCollection(new Uri(serverURL));
        VersionControlServer vcs = tfsTeamCol.GetService<VersionControlServer>();

        var history = vcs.QueryHistory("$/*", // The local path to an item for which history will be queried. This parameter can include wildcards
                                         VersionSpec.Latest, //Search latest version
                                         0, //No unique deletion id
                                         RecursionType.Full, //Full recursion on the path
                                         null, //All users
                                         new DateVersionSpec(DateTime.Now - TimeSpan.FromDays(7)), //From the 7 days ago ... 
                                         LatestVersionSpec.Instance, //To the current version ...
                                         Int32.MaxValue, //Include all changes. Can limit the number you get back.
                                         false, //Don't include details of items, only metadata. 
                                         false //Slot mode is false. 
                                        );

int changesetCounter = 0;
        foreach (Changeset changeset in history)
        {
            changesetCounter++;
         //...
        }

如果有更好的解决方案,请告诉我!

I found the solution myself. Maybe someone can use it:

TfsTeamProjectCollection tfsTeamCol = new TfsTeamProjectCollection(new Uri(serverURL));
        VersionControlServer vcs = tfsTeamCol.GetService<VersionControlServer>();

        var history = vcs.QueryHistory("$/*", // The local path to an item for which history will be queried. This parameter can include wildcards
                                         VersionSpec.Latest, //Search latest version
                                         0, //No unique deletion id
                                         RecursionType.Full, //Full recursion on the path
                                         null, //All users
                                         new DateVersionSpec(DateTime.Now - TimeSpan.FromDays(7)), //From the 7 days ago ... 
                                         LatestVersionSpec.Instance, //To the current version ...
                                         Int32.MaxValue, //Include all changes. Can limit the number you get back.
                                         false, //Don't include details of items, only metadata. 
                                         false //Slot mode is false. 
                                        );

int changesetCounter = 0;
        foreach (Changeset changeset in history)
        {
            changesetCounter++;
         //...
        }

If there is a better solution, please let me know !

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