Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何通过程序在sharepoint 2013中添加组中的用户_Sharepoint_Sharepoint 2010_Sharepoint 2013_Sharepoint 2007 - Fatal编程技术网

如何通过程序在sharepoint 2013中添加组中的用户

如何通过程序在sharepoint 2013中添加组中的用户,sharepoint,sharepoint-2010,sharepoint-2013,sharepoint-2007,Sharepoint,Sharepoint 2010,Sharepoint 2013,Sharepoint 2007,我正在制作一个窗口应用程序,当某个主体输入用户ID时,它将自动添加到用户组中。我正在制作一个窗口应用程序代码,如下所示: Imports Microsoft.SharePoint.Client Imports System Imports System.Collections.Generic Imports System.Linq Imports System.Text Imports System.Threading.Tasks Imports System.IO Public Class

我正在制作一个窗口应用程序,当某个主体输入用户ID时,它将自动添加到用户组中。我正在制作一个窗口应用程序代码,如下所示:

Imports Microsoft.SharePoint.Client
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports System.IO

Public Class Form1


    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        ClientContext ClientContext = New ClientContext("http://ServerName/Pages/Default.aspx")

    End Sub
End Class

现在,我在说客户端上下文是一种类型且不能用作表达式时出错。如何使用客户端上下文添加url/我正在VS2015中使用Vb.net。

这里我看到的问题是变量的名称。尝试提供名称_clientContext,并在方法中传递sharepoint站点而不是页面的url

Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports System.IO

Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    ClientContext _clientContext= New ClientContext("<siteUrl>")

End Sub
End Class
导入系统
导入System.Collections.Generic
导入系统
导入系统文本
导入System.Threading.Tasks
导入System.IO
公开课表格1
私有子表单1_Load(发送方作为对象,e作为事件参数)处理MyBase.Load
ClientContext_ClientContext=新的ClientContext(“”)
端接头
末级