Я новичок в C #, и я хотел бы знать, как вызвать приведенный ниже код с помощью Reflection.
ClientContext clientContext = new ClientContext(siteURL);
List documentList = clientContext.Web.Lists.GetByTitle(documentLibrary);
Имеет зависимость от Microsoft.SharePoint.Client.dll
и Microsoft.SharePoint.Client.Runtime.dll
.
Мне удалось создать объект clientContext. Однако я не могу вызвать другую часть, т.е.
Web.Lists.GetByTitle(documentLibrary);
Ниже приведен мой код для создания clientContext.
Type clinetContext = null;
foreach (Type type in sharePointClientTypes)
if (type.FullName.Equals("Microsoft.SharePoint.Client.ClientContext"))
{
clinetContext = type;
break;
}
ConstructorInfo constructorInfo = clinetContext.GetConstructor(new[] { typeof(string) });
object context = constructorInfo.Invoke(new string[] { siteURL });
Может ли кто-нибудь мне помочь !!