首页  编辑  

获得文件类型的默认打开方式

Tags: /C#/注册表读取/   Date Created:

using Microsoft . Win32;

RegistryKey vRegistryKey =

    Registry . ClassesRoot . OpenSubKey( @".wmv" );

if (vRegistryKey == null ) return ;

vRegistryKey = Registry . ClassesRoot . OpenSubKey(

   vRegistryKey . GetValue( "" ) . ToString() + @"\shell\open\command" );

if (vRegistryKey == null ) return ;

MessageBox . Show(vRegistryKey . GetValue( "" ) . ToString());