0
파일이 있으면 zip 파일의 내용을 확인하고 싶습니다. 그렇다면이 콘텐츠를 comboBox
에 나열하고 싶습니다. 내가 시도하는 것은 잘 작동하지만 체크는 수행되지 않았다.zip 파일의 내용을 확인한 다음 열기 및 읽기 및 내용을 콤보 상자에 C# WF
var = comboBox1.SelectedItem.ToString();
fullpath = fbd.SelectedPath + "\\"+ var;
comboBox2.Items.Clear();
if (File.Exists(fullpath))
{
ZipArchive zip = ZipFile.OpenRead(fullpath);
foreach (ZipArchiveEntry entry in zip.Entries)
{
comboBox2.Items.Add(entry.FullName); // fill comboBox2 with *.csv files from selected zip file
}
zip.Dispose();
}
else
{
MessageBox.Show("no csv files present");
}
나는 거기에 하나 이상의 CVS zip 파일에 존재하는 파일이며, 저에게이 우편에 포함 된 파일의 수를주는 경우에 저를 알려주는 메시지를 프로그램하고 싶었다. 나는 이것을 시도했지만 작동하지 않는다 : MessageBox.Show (Directory.EnumerateFileSystemEntries (fullpath, "* .csv").)() .Count + "csv file (s) present"); // 여기에 오류가 발생합니다 –
무엇이 오류입니까? – Ankit
처리되지 않은 'System.IO.IOException'유형의 예외가 mscorlib.dll에서 발생했습니다. 추가 정보 : 디렉터리 이름이 잘못되었습니다. 이 예외 유형이 발생할 때 중단하십시오. –