Add to User programmatically Sharepoint Group

Assignant user coetus muscus 2007

Sequens codice addam user coetus iaculis in specificatur.

nulla privatim adduser(string strSite,string webGroup)
{
SPSecurity.RunWithElevatedPrivileges(delegato()
{
usura (= New site SPSite SPSite(strSite))
{
usura (SPWeb web site.OpenWeb =())
{
Boolean allowUnsafeUpdate web.AllowUnsafeUpdates =;
tentant
{
verum web.AllowUnsafeUpdates =;

web.SiteUsers.Add(loginName, Mails, loginId, “”);
web.Groups[webGroup].Adduser(loginName, Mails, loginId, “”);

}
tandem
{
= web.AllowUnsafeUpdates allowUnsafeUpdate;
}
}
}
});
}

Aliquam pharetra

Vos can utor his HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>