Click here to Skip to main content
15,881,600 members
Home / Discussions / C#
   

C#

 
AnswerRe: Proper use of Tag property Pin
N a v a n e e t h17-Sep-08 21:55
N a v a n e e t h17-Sep-08 21:55 
GeneralRe: Proper use of Tag property Pin
Mycroft Holmes17-Sep-08 22:08
professionalMycroft Holmes17-Sep-08 22:08 
AnswerRe: Proper use of Tag property Pin
Pete O'Hanlon17-Sep-08 21:58
mvePete O'Hanlon17-Sep-08 21:58 
GeneralRe: Proper use of Tag property Pin
Mycroft Holmes17-Sep-08 22:00
professionalMycroft Holmes17-Sep-08 22:00 
GeneralRe: Proper use of Tag property Pin
N a v a n e e t h17-Sep-08 22:03
N a v a n e e t h17-Sep-08 22:03 
GeneralRe: Proper use of Tag property Pin
Pete O'Hanlon17-Sep-08 22:32
mvePete O'Hanlon17-Sep-08 22:32 
GeneralRe: Proper use of Tag property Pin
N a v a n e e t h17-Sep-08 23:50
N a v a n e e t h17-Sep-08 23:50 
Questionauthentication issue Pin
George_George17-Sep-08 21:40
George_George17-Sep-08 21:40 
Hello everyone,


I am accessing a web site using Windows Integrated authentication. I and the web server are in the same domain using IIS 6.0. Server runs on Windows Server 2003 and the client runs on Windows Vista.

When using the following code segment, there is always 401 error and exception. But when I am using the System.Net.CredentialCache.DefaultCredentials, the code runs successfully. Any ideas what is wrong?

try
 {
     HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://TestWeb/Monitor");

     NetworkCredential myCred = new NetworkCredential("domain\\user", "mypass");
     CredentialCache myCredentialCache = new CredentialCache();
     myCredentialCache.Add(new Uri("http://TestWeb/Monitor"), "NTLM", myCred);
     req.Credentials = myCredentialCache;

     req.ContentType = "text/xml";
     req.Method = "GET";
     req.Accept = "text/xml";

     WebResponse resp = req.GetResponse();
     StreamReader sr = new StreamReader(resp.GetResponseStream());
     Console.Write(sr.ReadToEnd()); //Just output XML response
 }
 catch (Exception ex)
 {
     Console.WriteLine(ex.ToString());
 }



thanks in advance,
George
AnswerRe: authentication issue Pin
leppie17-Sep-08 22:21
leppie17-Sep-08 22:21 
GeneralRe: authentication issue Pin
George_George17-Sep-08 23:01
George_George17-Sep-08 23:01 
GeneralRe: authentication issue Pin
leppie17-Sep-08 23:06
leppie17-Sep-08 23:06 
GeneralRe: authentication issue Pin
George_George17-Sep-08 23:24
George_George17-Sep-08 23:24 
GeneralRe: authentication issue Pin
leppie17-Sep-08 23:40
leppie17-Sep-08 23:40 
GeneralRe: authentication issue Pin
George_George18-Sep-08 0:01
George_George18-Sep-08 0:01 
Questioncreate a changing in pin code number of atm application in c# Pin
mdiqbal8717-Sep-08 21:34
mdiqbal8717-Sep-08 21:34 
JokeRe: create a changing in pin code number of atm application in c# PinPopular
Giorgi Dalakishvili17-Sep-08 21:37
mentorGiorgi Dalakishvili17-Sep-08 21:37 
GeneralRe: create a changing in pin code number of atm application in c# Pin
mdiqbal8717-Sep-08 21:43
mdiqbal8717-Sep-08 21:43 
GeneralRe: create a changing in pin code number of atm application in c# Pin
N a v a n e e t h17-Sep-08 21:53
N a v a n e e t h17-Sep-08 21:53 
JokeRe: create a changing in pin code number of atm application in c# Pin
Giorgi Dalakishvili17-Sep-08 21:57
mentorGiorgi Dalakishvili17-Sep-08 21:57 
JokeRe: create a changing in pin code number of atm application in c# Pin
Mycroft Holmes17-Sep-08 21:55
professionalMycroft Holmes17-Sep-08 21:55 
JokeRe: create a changing in pin code number of atm application in c# Pin
Giorgi Dalakishvili17-Sep-08 22:00
mentorGiorgi Dalakishvili17-Sep-08 22:00 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Dewald18-Sep-08 1:04
Dewald18-Sep-08 1:04 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Giorgi Dalakishvili18-Sep-08 1:12
mentorGiorgi Dalakishvili18-Sep-08 1:12 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Member 1372570716-Mar-18 7:31
Member 1372570716-Mar-18 7:31 
GeneralRe: create a changing in pin code number of atm application in c# Pin
Dan Neely18-Sep-08 2:28
Dan Neely18-Sep-08 2:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.