/// <summary> /// Construct the SharePointClient object using login details /// </summary> /// <param name="spLoginInfo">An object of SharePointLoginInfo</param> public SharePointClient(SharePointLoginInfo spLoginInfo) { if (spLoginInfo.SiteURL == null) throw new ArgumentException("SharePoint site URL cannot be null/empty, its required to open connection."); this._spLoginInfo = spLoginInfo; this._ctx = new ClientContext(this._spLoginInfo.SiteURL); if (!string.IsNullOrEmpty(this._spLoginInfo.UserName)) { this._ctx.Credentials = new NetworkCredential(this._spLoginInfo.DecryptedUserName, this._spLoginInfo.DecryptedPassword, this._spLoginInfo.DecryptedDomain); } }
/// <summary> /// Construct the SharePointClient object using login details /// </summary> /// <param name="spLoginInfo">An object of SharePointLoginInfo</param> public SharePointClient(SharePointLoginInfo spLoginInfo) { if (spLoginInfo.SiteURL == null) { throw new ArgumentException("SharePoint site URL cannot be null/empty, its required to open connection."); } this._spLoginInfo = spLoginInfo; this._ctx = new ClientContext(this._spLoginInfo.SiteURL); if (!string.IsNullOrEmpty(this._spLoginInfo.UserName)) { this._ctx.Credentials = new NetworkCredential(this._spLoginInfo.DecryptedUserName, this._spLoginInfo.DecryptedPassword, this._spLoginInfo.DecryptedDomain); } }