Hi,
First of all - i googled the problem, and nothing good related seemed to come up. Also it will probably seem to you that this question is a newbie one (and i must say i never had this problem when printing files in a directory. I am pretty new to WPF in C#.
so.. I am having problems to Print all files in directory that has ".xml" format
Here is my code to print the files in a directory (I am not talking about Recursive dirs and files print):
private void Load_ToolboxItems(string dirPath, string os, string version)
{
try
{
foreach (string command in Directory.GetFiles(dirPath, "*.xml"))
{
//load commands by OS compatibility
MessageBox.Show(command);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
This is my window load event:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
MessageBox.Show("Combined " + System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName), @"\data\Windows\xp\"));
MessageBox.Show(System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName));
Load_ToolboxItems(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName), @"\data\Windows\xp\"), "Windows", "XP");
}
Those are the outputs i get when running the program:
1st messagebox- "Combined \data\Windows\xp\"
2nd messagebox-
C:\Users\Din\Din\Programming\Webs\Ended Projects\LogicalArm\Products\Visual Command Line\Visual_Command_Line-wpf_net3.5c_vs2010\Visual_Command_Line\bin\Release
3rd messagebox- "could not find part of the path 'C:\data\Windows\xp'."
This is where the exe starts from:
C:\Users\Din\Din\Programming\Webs\Ended Projects\LogicalArm\Products\Visual Command Line\Visual_Command_Line-wpf_net3.5c_vs2010\Visual_Command_Line\bin\Release
Thanks in advanced to the helpers