重命名文档工作区

发布于 2024-12-15 22:00:47 字数 1403 浏览 0 评论 0原文

答案在这里,我原来的问题如下......

更改文档工作区就是这么简单:

使用 .../web_reference/dws.asmx

            using (Dws DWS = new Dws())
            {
                DWS.Credentials = CredentialCache.DefaultCredentials;
                DWS.Url = "http://sharepointsite/" + Domain + "//_vti_bin//dws.asmx";

                DWS.RenameDws("New Title goes here");
            }

虽然使用 Webs.asmx 可能可以做到这一点,但我无法想象它出来了。

<======原始问题========>

我在 SharePoint 中创建了一个新的文档工作区,内容如下:

           using (sp_Meetings.Meetings adm = new sp_Meetings.Meetings())
        {
            adm.Credentials = System.Net.CredentialCache.DefaultCredentials;
            adm.Url = "http://sharepoint/_vti_bin/Meetings.asmx";
            try
            {
                XmlNode CreatedSite =  adm.CreateWorkspace(Domain, "Supplier.stp", 1033, new sp_Meetings.TimeZoneInf());
            }
            catch (Exception e)
            {
                MessageBox.Show("EXCEPTION: " + e.Message);
            }
        }

网站已正确创建,但 URL 和标题始终相同。

 url: http://sharepointsite.com/sites/*domain*
 page title:  *domain*

显然这不起作用,因为我希望我的标题包含空格,而我的 URL 不包含空格。由于它们都从“域”变量中提取,我需要一个更细粒度的解决方案。有没有办法重新命名以编程方式制作的共享点页面?

我尝试了这个:

              adm.SetWorkSpaceTitle("Nice Title");

但它抛出 SOAP 错误。

The answere is here, and my original question is below.....

Changing the document workspace is this easy:

using .../web_reference/dws.asmx

            using (Dws DWS = new Dws())
            {
                DWS.Credentials = CredentialCache.DefaultCredentials;
                DWS.Url = "http://sharepointsite/" + Domain + "//_vti_bin//dws.asmx";

                DWS.RenameDws("New Title goes here");
            }

While this may be possible using the Webs.asmx, I couldn't figure it out.

<======ORIGINAL QUESTION========>

I've created a new document workspace in SharePoint with the following:

           using (sp_Meetings.Meetings adm = new sp_Meetings.Meetings())
        {
            adm.Credentials = System.Net.CredentialCache.DefaultCredentials;
            adm.Url = "http://sharepoint/_vti_bin/Meetings.asmx";
            try
            {
                XmlNode CreatedSite =  adm.CreateWorkspace(Domain, "Supplier.stp", 1033, new sp_Meetings.TimeZoneInf());
            }
            catch (Exception e)
            {
                MessageBox.Show("EXCEPTION: " + e.Message);
            }
        }

The site is created properly, but the URL and the title are always the same.

 url: http://sharepointsite.com/sites/*domain*
 page title:  *domain*

Obviously this doesn't work because I want my Title to contain spaces, and my URL to not contain spaces. Since they both pull from the "domain" variable, i need a more granular solution.Is there any way to re-title a sharepoint page made programatically?

I tried this:

              adm.SetWorkSpaceTitle("Nice Title");

but it throws SOAP errors.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扎心 2024-12-22 22:00:47

在创建站点之前您无法执行此操作。创建站点后,您需要获取 SPWeb 对象并使用该对象模型来更新标题。然后它应该可以毫无问题地工作......

You cannot do it before the site is created. Once the site is created, you need to get the SPWeb object and use the object model to update the title. it should then work without any issues...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文