在.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.例如, docs. microsoft/en-us/dotnet/api/?view=netcore-2.0&term=File 显示没有任何相关内容.这也是.NET Core开发人员当前的立场: github/dotnet/core/issues/374
.NET Core itself does not include APIs for any UI. For example, docs.microsoft/en-us/dotnet/api/?view=netcore-2.0&term=File shows nothing relevant. This is also the current stance of .NET Core developers: github/dotnet/core/issues/374
有几种外部库可能在特定平台上运行:
There are several external libraries that may work on specific platforms:
- github/AvaloniaUI/Avalonia
- www.mono-project/docs/gui/gtksharp /
- github/AvaloniaUI/Avalonia
- www.mono-project/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
发布评论