.NET Core 上的 OpenFileDialog [英] OpenFileDialog on .NET Core

查看:32
本文介绍了.NET Core 上的 OpenFileDialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 .NET Framework 上,您可以使用 System.Windows.Forms.OpenFileDialog 通过本机 Windows UI 打开文件,但这仅适用于 Windows.

On .NET Framework you can use System.Windows.Forms.OpenFileDialog for open files with the native Windows UI but that only works on Windows.

.Net Core 或其他替代方案有 System.Windows.Forms.OpenFileDialog 实现吗?

There is a System.Windows.Forms.OpenFileDialog implementation for .Net Core or another alternative?

推荐答案

.NET Core 本身不包含用于任何 UI 的 API.例如,https://docs.microsoft.com/en-us/dotnet/api/?view=netcore-2.0&term=File 未显示任何相关内容.这也是 .NET Core 开发人员目前的立场:https://github.com/dotnet/core/issues/374

.NET Core itself does not include APIs for any UI. For example, https://docs.microsoft.com/en-us/dotnet/api/?view=netcore-2.0&term=File shows nothing relevant. This is also the current stance of .NET Core developers: https://github.com/dotnet/core/issues/374

有几个可以在特定平台上运行的外部库:

There are several external libraries that may work on specific platforms:

如果您并没有真正依赖于 .NET Core 本身.UWP(建立在 .NET Standard 之上,但与 .NET Core 不同)也可能是一种选择.

If you are not really tied to .NET Core itself. UWP (which builds on top of .NET Standard but is different from .NET Core) may be an option too.

这篇关于.NET Core 上的 OpenFileDialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆