Greetings everyone,
I want to grab some data from a local site hosted on sharepoint services. I tried using the HttpWebRequest & HttpWebResponse classes. Here is the exact code
-----------------------
string lcUrl = "http://xxxxx/";
HttpWebRequest loHttp = (HttpWebRequest) WebRequest.Create(lcUrl);
loHttp.Timeout = 10000;
loHttp.UserAgent = "Code Sample Web Client";
HttpWebResponse loWebResponse = (HttpWebResponse) loHttp.GetResponse();
-----------------------
The problem is I could not open the connection because maybe the site does not allow anonymous access. How do I provide my credentials and open the site and retrieve data.The Credentials property - use a System.Net.NetworkCredential instance containing the details for a user with administrative rights on SharePoint, and also set the PreAuthenticate property to "true"
Monday, March 26, 2012
Permission & Access problem.
Labels:
access,
asp,
grab,
greetings,
httpwebrequest,
httpwebresponse,
local,
net,
permission,
services,
sharepoint
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment