T
Trond Hoiberg
I have an XML file with some data:
<Directlist>
<Directory>
<ID>1</ID>
<name>DirectoryRed</name>
</Directory>
<Directory>
<ID>2</ID>
<name>DirectoryBlue</name>
</Directory>
<Directory>
<ID>3</ID>
<name>DirectoryWhite</name>
</Directory>
</Directlist>
Is there a way i can read only the <name> (DirectoryRed, DirectoryBlue,
DirectoryWhite) into an array and then generate Folders using a method like
this (example):
public static void CreateDirectory(string directory)
{
string path = directory;
try
{
if (!Directory.Exists(path))
{
// Create the directory it does not exist.
Directory.CreateDirectory(path);
}
}
catch (Exception e)
{
MessageBox.Show("Creating directory failed: {0}", e.ToString());
}
finally {}
}
THe result will be 3 new folders
best regards
Trond
<Directlist>
<Directory>
<ID>1</ID>
<name>DirectoryRed</name>
</Directory>
<Directory>
<ID>2</ID>
<name>DirectoryBlue</name>
</Directory>
<Directory>
<ID>3</ID>
<name>DirectoryWhite</name>
</Directory>
</Directlist>
Is there a way i can read only the <name> (DirectoryRed, DirectoryBlue,
DirectoryWhite) into an array and then generate Folders using a method like
this (example):
public static void CreateDirectory(string directory)
{
string path = directory;
try
{
if (!Directory.Exists(path))
{
// Create the directory it does not exist.
Directory.CreateDirectory(path);
}
}
catch (Exception e)
{
MessageBox.Show("Creating directory failed: {0}", e.ToString());
}
finally {}
}
THe result will be 3 new folders
best regards
Trond