TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
meat meat
NA
6
0
ACCESING WEBDAV (RUNNING ON APACHE SERVER) USING C#
Dec 20 2007 9:54 PM
HI !
My company bought a software for stroring and accessing document and the software allows us to access document using webdav. That webdav run in Apache server .
I tried to use C# to access the document from webdav but it keep throwing unauthorized 401 error.
I can access that webdav url in IE or in My Network Place and It works fine.
Can anybody tell me how to authenticate to webdav url?
Can anybody help me and show me how to access a webdav url folder ?
I want to get all the folder list and the files also.
This is the code that I wrote to access the webdav URL
string strRootURI = "http://URL/webdav";
string strUserName = "USERID";
string strPassword = "PASSWORD";
string strDomain = "DOMAIN";
string strQuery = "";
byte[] bytes = null;
System.Net.CredentialCache MyCredentialCache = new System.Net.CredentialCache();
MyCredentialCache.Add(new System.Uri(strRootURI),
"Basic",//"NTLM","Negotiate" //I TRIED THREE DIFFERENT AUTH TYPE DOESN'T WORK ALSO
new System.Net.NetworkCredential(strUserName, strPassword, strDomain)
);
// Create the HttpWebRequest object.
System.Net.HttpWebRequest Request = (System.Net.HttpWebRequest)HttpWebRequest.Create(strRootURI);
// Add the network credentials to the request.
Request.Credentials = MyCredentialCache;
System.Net.WebResponse Response = (HttpWebResponse)Request.GetResponse(); //==> THROW AN 401 UNAUTHORIZED ERROR
response.Close();
Reply
Answers (
0
)
How to update Page.Header from User Control with Master/Content Page
Downloading an EXE from a webpage