Kentico UserInfoProvider not working as expected in a console app

前端 未结 3 1737
花落未央
花落未央 2021-01-28 09:24

This code works fine within a Kentico website:

var users = UserInfoProvider.GetUsers();
for (int x = 0; x < users.Count(); x++
{
    UserInfo currentUser = us         


        
3条回答
  •  被撕碎了的回忆
    2021-01-28 10:07

    For anyone looking to get a SiteID to use in API calls from an external app such as getting an email template, this might help you. In Kentico 8.1 you can go to Sites > General and get the code name for your site. Then you can do this:

    int siteID = CMS.SiteProvider.SiteInfoProvider.GetSiteID("");
    

    Hope it helps!

提交回复
热议问题