I am new to sharepoint technology. I want to know if it is possible to read a website hosted in sharepoint. I can see that page after I log in. Can I do that in C#? And do I have API to do the log in process to get the login info?
I tried this code to access my sharepoint site via my C# code:
ClientContext context = new ClientContext("https://mycompany.sharepoint.com/sites/parts/"); var credentials = new NetworkCredential(mywindowsusername, mywindowspassword); context.Credentials = credentials; // The SharePoint web at the URL. Web web = context.Web; // We want to retrieve the web's properties. context.Load(web); // Execute the query to the server. context.ExecuteQuery(); // Now, the web's properties are available and we could display // web properties, such as title. System.Console.WriteLine("Web Title"); System.Console.WriteLine(web.Title);
But I keep getting 403 error.