사용자가 시스템의 이동식 디스크에서 파일 만 선택할 수있는 열린 대화 상자를 표시하려고합니다. 아래 코드를 사용하고 있습니다. 하지만 대화 상자를 열려면 이동식 디스크의 Guid를 가져와야합니다.C에서 이동식 디스크를 표시하는 Opendialog #
것은
System.Windows.Forms.OpenFileDialog dls = new System.Windows.Forms.OpenFileDialog();
dls.CustomPlaces.Clear();
foreach (DriveInfo Drive in ListDrives)
{
if (Drive.DriveType == DriveType.Removable)
{
dls.CustomPlaces.Add(-----Guid of Drive------);
}
dls.ShowDialog();
}
이미 Drive.Name을 입력하여 시도했지만 대화 상자가 다른 드라이브에있는 응용 프로그램의 경로를 엽니 다. – Anuya
* 이동식 드라이브 *의 대화 상자를 열어서 * 애틀 거리기 시작한 다음 ** dls.InitialDirectory = item.Name; ** – TheVillageIdiot