472,797 Members | 1,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,797 software developers and data experts.

Loading XmlDocument with a file on network?

Can you load an XmlDocument with a file located on a network share? I thought maybe the XmlResolver could be used

XmlUrlResolver resolver = new XmlUrlResolver()
resolver.Credentials = CredentialCache.DefaultCredentials
// Create and load the XmlDocument
XmlDocument doc = new XmlDocument()
doc.XmlResolver = resolver; // Set the resolver
doc.Load(@"\\devsrv\profiles\0004.xml")

OR..

doc.Load("//devsrv/profiles/0004.xml")

But I get: "Logon failure: unknown user name or bad password"
Nov 12 '05 #1
1 2461
The problem is probably that the account that your application is running
under does not have access to the network share. Are you trying to read the
XML document from a desktop app or a Windows service (like ASP.NET for
example)

--
Christoph Schittko [MVP]
Software Architect, .NET Mentor

"Dave" <an*******@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
Can you load an XmlDocument with a file located on a network share? I thought maybe the XmlResolver could be used.
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = CredentialCache.DefaultCredentials;
// Create and load the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.XmlResolver = resolver; // Set the resolver.
doc.Load(@"\\devsrv\profiles\0004.xml");

OR...

doc.Load("//devsrv/profiles/0004.xml");

But I get: "Logon failure: unknown user name or bad password"

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Morten Nielsen | last post by:
I'm trying to load an XML file, that references a DTD without a relative URL. This renders the error: Could not find file "C:\WINNT\system32\capabilities_1_1_0.dtd". Here's the XML I'm loading:...
0
by: Sonu Kapoor | last post by:
I tried the code and it works without any probs. The prob must be in your network. Maybe you have to reconfigure your Firwall. Sonu http://weblogs.asp.net/sonukapoor/ >-----Original...
7
by: Christofer Dutz | last post by:
Hi, I am trying to read a XML-File which I marked as embedded resource from within the code of my DLL. Unfortunately it doesn't work. On my search for the error I inserted some code for...
4
by: Gustaf Liljegren | last post by:
This may be a question of taste, but if there is a best practice, I want to know. I have two choises: SomeClass s = new SomeClass(file); // Load the file or SomeClass s = new SomeClass();...
7
by: emma_middlebrook | last post by:
Hi In one of our test suites we load an xml document (it's actually .svg). I'm trying to find some way of stopping the eventual call to HttpWebRequest.GetResponse which I presume it's doing when...
0
by: speedcoder | last post by:
hi all, i'm stumped. my applet used to load images over the network. (it was actually designed by someone else.) yes, the applet used to load each image file independently over the network and...
1
by: Pesci Drums | last post by:
Hey There!... I've been dealing for hours trying to figure out why do I get the following error message: Type 'System.Xml.XmlDocument' in Assembly 'System.Xml, Version=2.0.0.0,...
6
by: cmorgan76 | last post by:
This is a 2 part question: Part 1: I am accesing a web service that returns an xml string of user information. I am attempting to load the XML into an XMLDocument, save the document, load it...
1
by: sasiphyd | last post by:
I have used an ajax file furnaces.html with code as below.The file furnacedata.php is used to generate XML dynamically and this appears to working well. timerID is used to reload the XML data at...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.