using Microsoft.SharePoint;
string strUrl =configurationManager.ConnectionStrings["SharePointUrl"].ToString();
SPSite spsite = new SPSite(strUrl);
SPWeb web = spsite.OpenWeb();
SPUserCollection UserList = web.SiteUsers;
Int32 count = 0;
foreach (SPUser u in UserList)
{
if (u.ID.ToString() != currentUserId.ToString() && u.Name.ToLower() != userName && u.Name != "System Account" && u.Name != "System Administrator" && u.Name != "SHAREPOINT\\system" && u.Name.ToUpper() != "NT AUTHORITY\\LOCAL SERVICE")
{
string userLoginName = u.LoginName.ToString();
userLoginName = userLoginName.Substring(userLoginName.IndexOf("\\") + 1);
ddlUserListTo.Items.Add(userLoginName.ToUpper());
ddlUserListTo.Items[count].Value = u.ID.ToString();
count += 1;
}
}
2 comments:
hope you got me.
Can you give the demo?
I am sure this will not work.
And do paste images also for post to be precise
Post a Comment