-3
컴파일 오류가 몇 번 발생합니다. 왜 그런지 잘 모릅니다.드라이브 메뉴의 이벤트 사용
static void Main(string[] args)
{
DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives)
{
Menu startMenu = new Menu() { Title = "Enter a drive" };
// The error is here: Invalid initializer member declarator
MenuItem d = new MenuItem() {Text = "{0}" , drive.Name};
if (drive.IsReady)
{
Console.CursorLeft = 5;
Console.Write(drive.VolumeLabel);
}
// another error: 'System.IO.DriveInfo' does not contain a definition for 'Selected' and no extension method 'Selected' accepting a first argument of type 'System.IO.DriveInfo' could be found (are you missing a using directive or an assembly reference?)
drive.Selected += drive_Selected;
startMenu.Items = new[] {d};
startMenu.Show();
}
}
private static void drive_Selected()
{
}
downvoting 사람들이 초보자에게 도움이된다고 생각합니까? 바보 같은 질문은 ... – hoang