|
-
Jun 20th, 2006, 07:07 PM
#1
Thread Starter
Hyperactive Member
[2.0] loading config.xml file into XMLDocument object
Task:
load an xml document into XMLDocument object.
XMLDocument xmldoc;
xmldoc.Load(xrdr);
This task can be done one step (as shown above) but the books & experienced programmer at work does that task in 4 different steps: curious to know opinion of other c# programmers.
FileStream input; // maintains connection to a file
StreamReader fileStreamReader; // reads data from a text file
XmlTextReader xrdr;
XmlDocument xmldoc;
//Create a filestream to get the read access to the file
input = new FileStream(StartUpPath, FileMode.Open, FileAccess.Read);
fileStreamReader = new StreamReader(input);
xrdr = new XmlTextReader(fileStreamReader);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|