I wanna add a user to SharePoint site. I could use spweb.EnsureUser to add a user by loginname. It works when I launch ConsoleApplication. Now I wanna add user through webservice.
The webservice and SharePoint site were deployed in the same IIS, and the authentication type is form authentication. Therefore the loginname looks like i:0#.f|ldapmember|testqq
I use following code to add user
using (SPSite spSite = new SPSite("http://sps.easyway.net.cn"))
using (SPWeb spWeb = spSite.OpenWeb())
View Complete Post