PhysicalMediaClass in der Wpf

Hey,

kennt sich jemand mit mder PhysicalMedia.Class aus???
schreib doch bitte mal…
danke

Hi,
wozu willst du die denn benutzen, wenn du nur die Laufwerke und Ordner des PC’s auslesen willst, geht das auch so:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;

namespace TreeViewLazyLoad
{
 /// 
 /// Interaction logic for Window1.xaml
 /// 
 public partial class MainWindow : Window
 {
 private object dummy = null;

 public MainWindow()
 {
 InitializeComponent();
 }

 void Window\_Loaded(object sender, RoutedEventArgs e)
 {
 foreach (string str in Environment.GetLogicalDrives())
 {
 TreeViewItem item = new TreeViewItem();
 item.Header = str;
 item.Tag = str;
 item.Items.Add(dummy);
 treeView.Items.Add(item);
 }
 }

 void treeViewItem\_Expanded(object sender, RoutedEventArgs e)
 {
 TreeViewItem item = e.OriginalSource as TreeViewItem;
 if (item != null)
 {
 if (item.Items.Count == 1 && item.Items[0] == dummy)
 {
 item.Items.Clear();
 try
 {
 foreach (string str in Directory.GetDirectories(item.Tag.ToString()))
 {
 TreeViewItem subitem = new TreeViewItem();
 subitem.Header = str.Substring(str.LastIndexOf('\\') + 1);
 subitem.Tag = str;
 subitem.Items.Add(dummy);
 item.Items.Add(subitem);
 }
 }

 catch (UnauthorizedAccessException ex)
 {
 }
 catch (IOException ex)
 {
 }
 }
 }
 }
 }
}

Lg der einzigware