如何找出Windows中使用的文件系统类型?最好是代码。
答案 0 :(得分:5)
function string get_FileSystem( strPath )
object objFSO, objDrive;
begin
set objFSO = CreateObject ( "Scripting.FileSystemObject" );
if ( IsObject (objFSO) ) then
try
set objDrive = objFSO.GetDrive( objFSO.GetDriveName( strPath ) );
if ( IsObject( objDrive ) ) then
//Available return types include FAT, NTFS, FAT, FAT32, and CDFS
return objDrive.FileSystem;
endif;
catch
MessageBox( "Unable to determine File System.", INFORMATION );
endcatch;
endif;
end;
来自http://kb.acresso.com/selfservice/viewContent.do?externalID=Q107782
答案 1 :(得分:3)
Console.WriteLine(new DriveInfo(Environment.SystemDirectory).DriveFormat);
C#
答案 2 :(得分:1)
在资源管理器中右键单击驱动器,选择“属性”。文件系统应该显示在那里。
答案 3 :(得分:1)
自1992年开始使用Win32 api:Win32 FAQ!
(见新闻://comp.os.ms-windows.programmer.win32)
答案 4 :(得分:1)
以下是可以帮助您的代码
foreach (DriveInfo objDrive in DriveInfo.GetDrives())
{
Response.Write("</br>Drive Type : " + objDrive.Name);
Response.Write("</br>Drive Type : " + objDrive.DriveType.ToString());
Response.Write("</br>Available Free Space : " + objDrive.AvailableFreeSpace.ToString() + "(bytes)");
Response.Write("</br>Drive Format : " + objDrive.DriveFormat);
Response.Write("</br>Total Free Space : " + objDrive.TotalFreeSpace.ToString() + "(bytes)");
Response.Write("</br>Total Size : " + objDrive.TotalSize.ToString() + "(bytes)");
Response.Write("</br>Volume Label : " + objDrive.VolumeLabel);
Response.Write("</br></br>");
}
答案 5 :(得分:0)
如果您的意思是Win32而不是.NET,请参阅WinAPI GetVolumeInformation()函数。您可以在http://msdn.microsoft.com
找到它