为什么我在下面的 C# LINQ 代码中收到以下错误
DriveInfo does not exist in current context
?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var drives = DriveInfo.GetDrives()
.Where(drive => drive.IsReady && drive.DriveType == DriveType.Removable);
}
}
}
提前谢谢了!