微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法连接到 sharepoint 站点

如何解决无法连接到 sharepoint 站点

我正在尝试连接到 Sharepoint 以读取 Excel 文件,但它在以下行崩溃:执行查询错误是:无法连接到 Sharepoint 站点

我尝试以各种方式提供 URL,但它不起作用。

        string userName = "My Email";
        string password = "12345";
        var siteurl = "https://xyz.sharepoint.com//sites//MySystems";
        var securePassword = new securestring();
        foreach (char c in password)
        {
            securePassword.AppendChar(c);
        }
        using (var clientContext = new ClientContext(siteurl))
        {
            var onlineCredentials = new SharePointOnlineCredentials(userName,securePassword);
            clientContext.Credentials = onlineCredentials;
            Web web = clientContext.Web;
            clientContext.Load(web,a => a.ServerRelativeUrl);
            clientContext.ExecuteQuery();
    }

解决方法

请确保您使用正确的网址。 URL 格式如下:https://xyz.sharepoint.com/sites/MySystems

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。