我们需要断开与sharepoint的连接吗?如果是,如何?

时间:2010-02-11 07:39:59

标签: c# sharepoint sharepoint-2007

我正在使用Web服务访问SharePoint列表,网站和文档。 喜欢:List.asmx,Site.asmx e.t.c。

我的问题是:

使用上述服务时是否需要断开与SharePoint的连接? 如果是,那么如何?

示例:

GetSiteCollection(String login, String password, String url)
{

Webs ws = new Webs();                
try
{
 ws.Credentials     = new NetworkCredential(login, password);                    
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
ws.Url              = url + @"/_vti_bin/webs.asmx";
ws.PreAuthenticate  = true;
XmlNode websiteNode = ws.GetWebCollection();
XmlNodeList nodes   = websiteNode.SelectNodes("*"); 

// getting list set of sites

//Now here after this is there any way to disconnect from server? 

}  

1 个答案:

答案 0 :(得分:3)

默认情况下,Web服务已断开连接,您通过发送和接收消息进行通信,因此无需断开连接。

相关问题