bnathvbdotnet
Jun 20th, 2006, 07:07 PM
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);
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);