Programsko Read Seznam & Pogled Vsebina v SharePointu

Dobil sem nalogo, da delajo na razvoju windows aplikacijo, ki bo puščati Seznam Oglejte si podatke o SharePoint in obdeluje podatke v win tvori aplikacijo.

Prej sem rabil, da prinese podatke na podlagi Lists.asmx,views.asmx.

Zdaj sem prišel, da veš, da je drug način pridobiti podatke iz cenika Poglej.

Skladnja:
https://myserver.com/_vti_bin/owssvr.dll?Cmd = Display&Seznam ={list Id}&View={View Id}&XMLDATA=true

Example URL:

https://myserver.com/_vti_bin/owssvr.dll?Cmd = Display&Seznam ={EA1BD05B-DB5B-434B-B2FC-B9AB9EE18A91}&View={B959F555-798B-4F47-9FBB-81513B85F906}&XMLDATA=true

Now it will give the xml data as response.

write the response to xmldoc and process the data.

HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(“https://myserver.com/_vti_bin/owssvr.dll?Cmd = Display&Seznam ={EA1BD05B-DB5B-434B-B2FC-B9AB9EE18A91}&View={B959F555-798B-4F47-9FBB-81513B85F906}&XMLDATA=true”);

myRequest.Credentials =
System.Net.CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)myRequest.GetResponse();
XmlDocument doc = new XmlDocument();
doc.Load(response.GetResponseStream());

Leave a Reply

Lahko uporabite te HTML oznake

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>