1、 获取SPS文档库的数据 SPSite site = SPControl.GetContextSite(Context); // 取该虚拟服务器上的根站点 SPWeb web = site.AllWebs[ " / " ]; // 取得Shared Documents这个文档库对象 SPDocumentLibrary docLib = (SPDocumentLibrary)web.Lists[ " Shared Documents " ]; // 获取文档库的数据 SPListItemCollection items = docLib.Items; foreach (SPListItem item in items) ... { Response.Write(SPEncode.HtmlEncode(item.Xml));} 2、修改AD登录密码 string userName = SPControl.GetContextWeb(Context).CurrentUser.LoginName;userName = userName.Remove( 0 , userName.LastIndexOf( ' \ ' ) + 1 );DirectoryEntry user = new DirectoryEntry( " WinNT://./ " + userName); try ... {user.Invoke("ChangePassword", new object[]...{oldPsw, newPsw});} catch (Exception ex) ... {output.WriteLine("出错啦");} ; 转载于:https://www.cnblogs.com/downmoon/archive/2007/12/27/1017630.html