1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      如何實(shí)現(xiàn)UnityC#GetSaveFileName()

      如何實(shí)現(xiàn)Unity C# GetSaveFileName()?相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。

      站在用戶的角度思考問題,與客戶深入溝通,找到西工網(wǎng)站設(shè)計(jì)與西工網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、國際域名空間、網(wǎng)絡(luò)空間、企業(yè)郵箱。業(yè)務(wù)覆蓋西工地區(qū)。

      先放個(gè)效果圖:

      如何實(shí)現(xiàn)Unity C# GetSaveFileName()

      首先需要定義一個(gè)OpenFileName的類:

      [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
      
      public class OpenFileName
      {
      	public int structSize = 0;
      	public IntPtr dlgOwner = IntPtr.Zero;
      	public IntPtr instance = IntPtr.Zero;
      	public String filter = null;
      	public String customFilter = null;
      	public int maxCustFilter = 0;
      	public int filterIndex = 0;
      	public String file = null;
      	public int maxFile = 0;
      	public String fileTitle = null;
      	public int maxFileTitle = 0;
      	public String initialDir = null;
      	public String title = null;
      	public int flags = 0;
      	public short fileOffset = 0;
      	public short fileExtension = 0;
      	public String defExt = null;
      	public IntPtr custData = IntPtr.Zero;
      	public IntPtr hook = IntPtr.Zero;
      	public String templateName = null;
      	public IntPtr reservedPtr = IntPtr.Zero;
      	public int reservedInt = 0;
      	public int flagsEx = 0;
      }

      當(dāng)然,也不是都用到了,只用到了一小部分,有性趣的童鞋可以個(gè)性化一下保存對話框,

      然后是最重要的委托GetSaveName()方法:

      public class DllUse
      {
      	[DllImport("Comdlg32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
      	public static extern bool GetSaveFileName([In, Out] OpenFileName ofn);
      }

      擋擋擋,最后調(diào)用一下即可:

      public static void OpenDialog(Action onSave)
          {
              OpenFileName ofn = new OpenFileName();
              ofn.structSize = Marshal.SizeOf(ofn);
          
              ofn.filter = "Excel (*.xls)\0*.xls\0\0";
              ofn.file = new string(new char[256]);
              ofn.maxFile = ofn.file.Length;
              ofn.fileTitle = new string(new char[64]);
              ofn.maxFileTitle = ofn.fileTitle.Length;
              ofn.initialDir = UnityEngine.Application.dataPath;//默認(rèn)路徑ofn.title = "保存文件";
              ofn.defExt = ".xls";//顯示文件的類型ofn.flags = 0x00080000 | 0x00001000 | 0x00000800 | 0x00000200 | 0x00000008;if (DllTest.GetSaveFileName(ofn))
              {
                  dosomething();string Savepath = Path.GetDirectoryName (ofn.file);
                  Process.Start (Savepath);
              }
          }

      如何實(shí)現(xiàn)Unity C# GetSaveFileName()

      如何實(shí)現(xiàn)Unity C# GetSaveFileName()

      看完上述內(nèi)容,你們掌握如何實(shí)現(xiàn)Unity C# GetSaveFileName()的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!


      分享文章:如何實(shí)現(xiàn)UnityC#GetSaveFileName()
      當(dāng)前URL:http://ef60e0e.cn/article/gsegpi.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        大洼县| 苏尼特左旗| 山丹县| 青田县| 改则县| 禹州市| 驻马店市| 保德县| 宁南县| 库尔勒市| 定远县| 拉萨市| 滨州市| 天峨县| 霞浦县| 方正县| 石屏县| 朝阳区| 桐梓县| 咸宁市| 庄浪县| 阿勒泰市| 南汇区| 万年县| 新丰县| 伊川县| 新兴县| 江永县| 山阴县| 瑞昌市| 青田县| 山丹县| 宣化县| 瓦房店市| 横峰县| 广东省| 巴南区| 壶关县| 阿拉尔市| 井冈山市| 安泽县|