title: C# WPF - Printing all files in directory that has ".xml" format - "could not find part of the path c#"
body: <p>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#.</p>
  
  <p>so..
  I am having problems to Print all files in directory that has ".xml" format</p>
  
  <p><strong>Here is my code to print the files in a directory (I am not talking about Recursive dirs and files print):</strong></p>
  
  <pre><code>    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);
          }
      }
  </code></pre>
  
  <p><strong>This is my window load event:</strong></p>
  
  <pre><code>    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");
      }
  </code></pre>
  
  <p><strong>Those are the outputs i get when running the program:</strong></p>
  
  <p>1st messagebox- "Combined \data\Windows\xp\"</p>
  
  <p>2nd messagebox-</p>
  
  <pre><code>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
  </code></pre>
  
  <p>3rd messagebox- "could not find part of the path 'C:\data\Windows\xp'."</p>
  
  <p><strong>This is where the exe starts from:</strong></p>
  
  <pre><code>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
  </code></pre>