Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to create a windows application which will access SharePoint 2010 site page to stote that page in ".htm" format in local drive.

But, that SharePoint site has claim based authentication.

For accessing that site I have to provide "Username" & "Password" along with "Domain name".

So, I need help on how can I pass site credentials through windows application to get access into that site??

I have used following code but this throws exception "The remote server returned an error: (403) Forbidden".

WebRequest Request1;
HttpWebResponse Response1;

Request1 = WebRequest.Create(txtUrl.Text.ToString());
Request1.Credentials = new NetworkCredential(strUserNm.ToString(), strPassword.ToString(), StrDomain.ToString());

Request1.PreAuthenticate = true;
Response1 = (HttpWebResponse)Request1.GetResponse();


Any help will be appreciable...
Posted
Updated 24-Jul-12 17:36pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900