WMPLibでmp3, wmaファイルなどのタグ情報を取得する方法。 Visual Studio .NET 2003 + Windows Media SDK 10.0
下準備
まず、Windows Media SDK Components 配布ページにてWindows Media SDKの最新版をダウンロード、インストールする(ここではバージョン10.0を使用)。
続いて、Visual Studio上でプロジェクトにwmp.dllへの参照を追加する。 「参照の追加」ダイアログの「COM」タブから「Windows Media Player」の項目を探し、選択・OK。
wmp.dll参照の追加

タグ情報を取得する
ファイルを開いてタグ情報を取得するサンプル。
WMPLib.WindowsMediaPlayerClass wmp = new WMPLib.WindowsMediaPlayerClass();
// ファイルを開く
wmp.URL = @"C:\Test.wma";
// これをやらないとうまく取得されない
wmp.currentMedia.setItemInfo( String.Empty, String.Empty );
// 曲のタイトル、アーティスト、アルバム名を取得して表示する
Console.WriteLine( wmp.currentMedia.getItemInfo("Title") );
Console.WriteLine( wmp.currentMedia.getItemInfo("Artist") );
Console.WriteLine( wmp.currentMedia.getItemInfo("Album") );
// 開いたファイルを閉じる
wmp.close();