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

查看:244
本文介绍了.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:

  • https://github.com/AvaloniaUI/Avalonia
  • http://www.mono-project.com/docs/gui/gtksharp/

如果您不是真的与.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天全站免登陆