EDN Admin
Well-known member
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small Hi folks,
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small Hi I am trying to read an XML file on a remote computer. In order to supply Login & password to read the file, I am using the following code. This method was suggested to
in attached response.
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small http://social.msdn.microsoft.com/Forums/en-US/xmlandnetfx/thread/e781db30-6782-4684-8ecd-9621ca08838e http://social.msdn.microsoft.com/Forums/en-US/xmlandnetfx/thread/e781db30-6782-4684-8ecd-9621ca08838e
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small However, no matter what I do, it keeps throwing an exception saying that âLogon failure: unknown user name or bad password.â
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small I feel pretty certain that the password, username is correct. I have tried the same username, password, manually and it works. But somehow when I use it in the code as shown,
it does not. Is something wrong in code below ? Is there way to trouble shoot this and see what really is going wrong, what really is missing ?
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:blue; font-size:10pt string<span style="font-family:Courier New; font-size:10pt myXmlFile =
<span style="color:#a31515 "\\123.456.789.12\c$\myXml.xml";
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
<span style="color:#2b91af XmlUrlResolver resolver = <span style="color:blue
new <span style="color:#2b91af XmlUrlResolver();
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
<span style="color:#2b91af NetworkCredential nc = <span style="color:blue
new <span style="color:#2b91af NetworkCredential();
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
nc.UserName = <span style="color:#a31515 "myusername";
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
nc.Password = <span style="color:#a31515 "mypassword";
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
nc.Domain = <span style="color:#a31515 "mydomain";
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
resolver.Credentials = nc;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:green; font-size:10pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
<span style="color:#2b91af XmlReaderSettings settings = <span style="color:blue
new <span style="color:#2b91af XmlReaderSettings();
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
settings.IgnoreComments = <span style="color:blue true;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
settings.IgnoreWhitespace = <span style="color:blue true;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
settings.XmlResolver = resolver;
<span style="font-family:Courier New; font-size:10pt <span>
<span style="color:#2b91af XmlReader reader = <span style="color:#2b91af
XmlReader.Create(myXmlFile, settings); <span style="font-family:Wingdings; font-size:10pt <span>Ã<span style="font-family:Courier New; font-size:10pt --Throws Exception
<
diana4<br/>
<br/>
View the full article
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small Hi folks,
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small Hi I am trying to read an XML file on a remote computer. In order to supply Login & password to read the file, I am using the following code. This method was suggested to
in attached response.
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small http://social.msdn.microsoft.com/Forums/en-US/xmlandnetfx/thread/e781db30-6782-4684-8ecd-9621ca08838e http://social.msdn.microsoft.com/Forums/en-US/xmlandnetfx/thread/e781db30-6782-4684-8ecd-9621ca08838e
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small However, no matter what I do, it keeps throwing an exception saying that âLogon failure: unknown user name or bad password.â
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small I feel pretty certain that the password, username is correct. I have tried the same username, password, manually and it works. But somehow when I use it in the code as shown,
it does not. Is something wrong in code below ? Is there way to trouble shoot this and see what really is going wrong, what really is missing ?
<p style="margin:0in 0in 10pt <span style="font-family:Calibri; font-size:small
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:blue; font-size:10pt string<span style="font-family:Courier New; font-size:10pt myXmlFile =
<span style="color:#a31515 "\\123.456.789.12\c$\myXml.xml";
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
<span style="color:#2b91af XmlUrlResolver resolver = <span style="color:blue
new <span style="color:#2b91af XmlUrlResolver();
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
<span style="color:#2b91af NetworkCredential nc = <span style="color:blue
new <span style="color:#2b91af NetworkCredential();
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
nc.UserName = <span style="color:#a31515 "myusername";
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
nc.Password = <span style="color:#a31515 "mypassword";
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
nc.Domain = <span style="color:#a31515 "mydomain";
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
resolver.Credentials = nc;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:green; font-size:10pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
<span style="color:#2b91af XmlReaderSettings settings = <span style="color:blue
new <span style="color:#2b91af XmlReaderSettings();
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
settings.IgnoreComments = <span style="color:blue true;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
settings.IgnoreWhitespace = <span style="color:blue true;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; font-size:10pt <span>
settings.XmlResolver = resolver;
<span style="font-family:Courier New; font-size:10pt <span>
<span style="color:#2b91af XmlReader reader = <span style="color:#2b91af
XmlReader.Create(myXmlFile, settings); <span style="font-family:Wingdings; font-size:10pt <span>Ã<span style="font-family:Courier New; font-size:10pt --Throws Exception
<
diana4<br/>
<br/>
View the full article