private string OpenDialogFile() { OpenFileName openFileName = new OpenFileName(); openFileName.structSize = System.Runtime.InteropServices.Marshal.SizeOf(openFileName); openFileName.filter = "IFC文件(*.ifc)\0*.ifc"; openFileName.file = new string(new char[256]); openFileName.maxFile = openFileName.file.Length; openFileName.fileTitle = new string(new char[64]); openFileName.maxFileTitle = openFileName.fileTitle.Length; openFileName.initialDir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);//默认路径 openFileName.title = "选择所需的ifc文件"; openFileName.flags = 0x00080000 | 0x00001000 | 0x00000800 | 0x00000008; if (OpenFileName.GetSaveFileName(openFileName)) { return(openFileName.file); } else { return(null); } }