Hi,
While trying to access a document on my server through my C# application ,it
says "Remote Server returned and Error : 401 Unauthorised" but when i access
it thro Internet Explorer it works fine.
I've used CredentialCache object and i've also tried "Authrorization" header
with Base64 algo.
string uidpwd = "abhimanyu:sirohi";
byte[] bytes = new byte[uidpwd.Length];
bytes = Encoding.UTF8.GetBytes(uidpwd);
WebResponse requestResponse = null;
CredentialCache MyCredentialCache = new CredentialCache();
MyCredentialCache.Add(new Uri("PATH"), "NTLM", new
NetworkCredential("username", "password"));
HttpWebRequest Request = (HttpWebRequest) HttpWebRequest.Create("PATH");
Request.Credentials = MyCredentialCache;
Request.Method = "GET";
Request.Headers.Add("Translate", "F");
Request.Headers.Add("Authorization", "NTLM " + Convert.ToBase64String(bytes));
requestResponse = Request.GetResponse();
plz help
regards