获取文个类型


            RegistryKey extsubkey = Registry.ClassesRoot.OpenSubKey(".doc");
            string extdefaultvalue = extsubkey.GetValue(null) as string;
            //if (extdefaultvalue.Equals("exefile", StringComparison.OrdinalIgnoreCase))  //扩展名类型是可执行文件 
            //{
                RegistryKey exefilesubkey = Registry.ClassesRoot.OpenSubKey(extdefaultvalue);  //从注册表中读取文件类型名称的相应子键 
                if (exefilesubkey != null)
                {
                    string exefiledescription = exefilesubkey.GetValue(null) as string;   //得到exefile描述字符串 
    
                }
           // }
        }

posted @ 2013-09-27 10:41  咸鱼公子  Views(322)  Comments(0Edit  收藏  举报