Unity-打开Windows文件夹浏览器
功能介绍:
打开Windows文件夹浏览器,返回选择的文件夹路径。
备注:
- 打开的浏览器文件夹始终置于最顶层。
- visibleInBackground要设置为true。
效果如下:
代码如下:
using System;
using System.Runtime.InteropServices;
namespace Folder
{
public class PathBrowser
{
// 浏览对话框中包含一个编辑框,在该编辑框中用户可以输入选中项的名字。
const int BIF_EDITBOX = 0x00000010;
// 新用户界面
const int BIF_NEWDIALOGSTYLE = 0x00000040;
const int BIF_USENEWUI = (BIF_NEWDIALOGSTYLE | BIF_EDITBOX);
const int MAX_PATH_LENGTH = 2048;
public static string FolderBrowserDlg(string defaultPath = "")
{
OpenDlgDir dlg = new OpenDlgDir();
dlg.pszDisplayName = de
最新文章
- JAVA里面继承和接口
- 计算机中的位,字节,字,字长的概念
- JavaGuide
- JKD1.8新特性
- RabbitMQ and Oslo.messaging
- 均衡负载
- 集群和均衡负载[摘]
- 常见的测试类型及其测试方法(一)
- 函数的callee和caller的区别和用处
- Jmeter的使用(一)
- 两种模块化语法(module.exports,exports,requireexport,import)
- Python四行代码实现的猜数字小游戏,基于thinker,带GUI界面
- TensorFlow Lite 开发手册(5)——TensorFlow Lite模型使用实例(分类模型)
- TensorFlow TFRecords简介
- 外贸业务员如何开发出更多的有效客户?
- 机器学习(三):基于线性回归对波士顿房价预测
- ROS2 基础概念 话题