免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
【新提醒】【Unity選擇本地文件夾和文件】
using System;
using System.Runtime.InteropServices;
public class WindowsExplorer
{
    [DllImport("Comdlg32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
    public static extern bool GetOpenFileName([In, Out] OpenDialogFile ofn);
    [DllImport("Comdlg32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
    public static extern bool GetSaveFileName([In, Out] OpenDialogFile ofn);
    [DllImport("shell32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
    public static extern IntPtr SHBrowseForFolder([In, Out] OpenDialogDir ofn);
    [DllImport("shell32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
    public static extern bool SHGetPathFromIDList([In] IntPtr pidl, [In, Out] char[] fileName);
    /// <summary>
    /// 調(diào)用WindowsExploer 并返回所選文件夾路徑
    /// </summary>
    /// <param name="dialogtitle">打開對話框的標題</param>
    /// <returns>所選文件夾路徑</returns>
    public static string GetPathFromWindowsExplorer(string dialogtitle = "請選擇下載路徑")
    {
        string res;
        OpenDialogDir ofn2 = new OpenDialogDir();
        ofn2.pszDisplayName = new string(new char[2000]); ;     // 存放目錄路徑緩沖區(qū) 
        ofn2.lpszTitle = dialogtitle;// 標題 
        ofn2.ulFlags = 0x00000040; // 新的樣式,帶編輯框 
        IntPtr pidlPtr = WindowsExplorer.SHBrowseForFolder(ofn2);
        char[] charArray = new char[2000];
        for (int i = 0; i < 2000; i++)
            charArray[i] = '\0';
        WindowsExplorer.SHGetPathFromIDList(pidlPtr, charArray);
        res = new String(charArray);
        res = res.Substring(0, res.IndexOf('\0'));
        return res;
    }
}
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
如何通過使用 Visual C#.net 將原始數(shù)據(jù)發(fā)送到打印機
C# 鍵盤監(jiān)視+剪切板編程
在Winform中嵌入exe程序
C# 實現(xiàn)對硬件的控制
IP地址輸入框
winmm.dll 函數(shù)詳細引用方法(C#)
更多類似文章 >>
生活服務(wù)
分享 收藏 導長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服