好像添加以下就行了,不过还是谢谢c#论坛
using System.Runtime.InteropServices;
[DllImport("kernel32.dll", SetLastError=true)] static extern int GetDriveTypeA ( string nDrive) ;
[DllImport("kernel32")]
static extern uint GetDriveType(string name);
[DllImport("kernel32")]
static extern bool GetDiskFreeSpaceEx(
string lpDirectoryName,
ref long lpFreeBytesAvailable,
ref long lpTotalNumberOfBytes,
ref long lpTotalNumberOfFreeBytes);