打开文件让用户选择文件并遍历所有选择的文件
public void OpenLibFileCommand ( )
{
logger. Info ( $"OpenModuleZipFileCommand-->" ) ;
System. Windows. Forms. OpenFileDialog open = new System. Windows. Forms. OpenFileDialog ( ) ;
open. Multiselect = true ;
open. Title = "选择需要加载的Lib文件或压缩包" ;
open. Filter = "格式dll|*.dll" ;
if ( open. ShowDialog ( ) == DialogResult. OK)
{
FilesOfAdd. Clear ( ) ;
filesToAdd. Clear ( ) ;
FilePath = open. FileName;
foreach ( string file in open. FileNames)
{
string pathName = System. IO. Path. GetDirectoryName ( file) ;
string fileName = System. IO. Path. GetFileNameWithoutExtension ( file) ;
filesToAdd. Add ( file) ;
FilesOfAdd. Add ( fileName) ;
}
}
else
{
System. Windows. MessageBox. Show ( "Please select a file !" , "Warn" , MessageBoxButton. OK, MessageBoxImage. Exclamation) ;
}
}