怎么判断当前系统是安装在哪个盘?
比如c盘、d盘等

解决方案 »

  1.   

    启动系统后,格式化D盘。如果成功,说明系统肯定没装在D盘,也就是说装在C盘。
      

  2.   

    Environment.SystemDirectory;
    获取系统路径[align=center]*****************************
    * 本内容使用CSDN 小秘书回复 *
    每天回帖即可得10分可用分! *
    *****************************[/align]
      

  3.   


    如果改过注册表,这个会被欺骗。
    办法是path = @"\WINDOWS\system32\user32.dll";
    File.delete("C:"+path);//catch,就是在C盘安装,以此判断各个盘符
      

  4.   

    Environment.GetFolderPath(Environment.SpecialFolder.System)foreach (DriveInfo drives in DriveInfo.GetDrives())
                {
                    if(Directory.Exists(drives.RootDirectory + "windows\\system32")
                    {
                 
                    }
                }