public static string SaveFilePath(string filter, string title, string extension)
    {
        FIleDialogStruct pth = new FIleDialogStruct();

        pth.structSize   = System.Runtime.InteropServices.Marshal.SizeOf(pth);
        pth.filter       = filter;
        pth.file         = new string(new char[256]);
        pth.maxFile      = pth.file.Length;
        pth.fileTitle    = new string(new char[64]);
        pth.maxFileTitle = pth.fileTitle.Length;
        pth.initialDir   = Application.dataPath; // default path
        pth.title        = title;
        pth.defExt       = extension;
        pth.flags        = 0x00080000 | 0x00001000 | 0x00000800 | 0x00000200 | 0x00000008;
        if (FIleDialogStruct.GetSaveFileName(pth))
        {
            return(pth.file);//选择的文件路径;
        }
        else
        {
            return(null);
        }
    }
 public static extern bool GetSaveFileName([In, Out] FIleDialogStruct ofd);
 public static extern bool GetOpenFileName([In, Out] FIleDialogStruct ofn);