Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public static bool GetSFN([In, Out] OpenFileName ofn)
 {
     return(GetSaveFileName(ofn));
 }
Ejemplo n.º 3
0
 public static extern bool GetSaveFileName([In, Out] OpenFileName ofn);