How do I convert this into Client Object Model, please. I have no full SP installed on the Machine.
I just need the list of sites and subsites in the Given URL..
public List<String> GetAllSites(string spURL)
{
IList<String> sites = new List<String>();
try
{
SPSite oSiteCollection = new SPSite(spURL);
SPWebCollection collWebsite = oSiteCollection.AllWebs;
for (int i = 0; i < collWebsite.Count; i++)
{
using (SPWeb oWebsite = collWebsite[i])
{
SPListCollection collList = oWebsite.Lists;
for (int j = 0; j < collList.Count; j++)
{
sites.Add(collWebsite[i].Title + collList[j].Title);
}
}
}
return sites.ToList();
}
catch (Exception ex)
{
log.Error(ex.StackTrace + ex.Message);
return sites.ToList();
}
}