public static OpenFileName CreateOpenFileName() { OpenFileName openFileName = new OpenFileName(); openFileName.structSize = Marshal.SizeOf(openFileName); openFileName.filter = "文本文件(*.txt)\0*.txt"; 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 = Application.streamingAssetsPath.Replace('/', '\\');//默认路径 openFileName.title = "窗口标题"; openFileName.flags = 0x00080000 | 0x00001000 | 0x00000800 | 0x00000008; return(openFileName); }
public static bool GetSFN([In, Out] OpenFileName ofn) { return(GetSaveFileName(ofn)); }
public static extern bool GetSaveFileName([In, Out] OpenFileName ofn);