api - Getting the GUID for any given path to sharepoint -


i'm trying guid of given sharepoint url. don't mind using api or webservices or sharepoint's database.

if write function, it's signature be: //get guid path. string getguidfrompath(string path){}

i had lead: spcontentmapprovider doesn't seem right info.

thank you!

depends - what's context of current request? code running in context of sharepoint request? if can use spcontext.current.web.id

otherwise, code @ least running on 1 of sharepoint servers? if you'll need use:

// given url http://mysharepointsite.com/sites/somesite/somesubsite  using(spsite site = new spsite("http://mysharepointsite.com/sites/somesite")) {     using(spweb web = site.openweb("somesubsite"))     {         guid webid = web.id;     }      // or     guid rootwebid = site.rootweb.id; } 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -