BootstrapBlazor.FileSystem 8.0.1

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package BootstrapBlazor.FileSystem --version 8.0.1
                    
NuGet\Install-Package BootstrapBlazor.FileSystem -Version 8.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BootstrapBlazor.FileSystem" Version="8.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BootstrapBlazor.FileSystem" Version="8.0.1" />
                    
Directory.Packages.props
<PackageReference Include="BootstrapBlazor.FileSystem" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BootstrapBlazor.FileSystem --version 8.0.1
                    
#r "nuget: BootstrapBlazor.FileSystem, 8.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BootstrapBlazor.FileSystem@8.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BootstrapBlazor.FileSystem&version=8.0.1
                    
Install as a Cake Addin
#tool nuget:?package=BootstrapBlazor.FileSystem&version=8.0.1
                    
Install as a Cake Tool

Blazor File System Access 文件系统访问 组件

Web 应用程序与用户本地设备上的文件进行交互

File System Access API(以前称为 Native File System API,在此之前称为 Writeable Files API)使开发人员能够构建强大的 Web 应用程序,与用户本地设备上的文件进行交互,例如 IDE、照片和视频编辑器、文本编辑器等。用户授予 Web 应用访问权限后,此 API 允许他们直接读取或保存对用户设备上文件和文件夹的更改。除了读取和写入文件之外,文件系统访问 API 还提供打开目录和枚举其内容的能力。

浏览器支持:

chrome 86 | firfox × | edge 86 | safari ×

Windows、macOS、ChromeOS 和 Linux 上的大多数 Chromium 浏览器目前都支持文件系统访问 API

示例:

https://blazor.app1.es/FileSystem

使用方法:

1.nuget包

BootstrapBlazor.FileSystem

2._Imports.razor 文件 或者页面添加 添加组件库引用

@using BootstrapBlazor.Components

3.razor页面

<FileSystem OnFileText="OnFileText" 
            OnFileStream="OnFileStream" 
            OnDirectory="OnDirectory" 
            />

<pre>@contents</pre>

@code{

    private string contents;

    private Task OnFileText(string contents)
    {
        this.contents = contents;
        StateHasChanged();
        return Task.CompletedTask;
    }
    
    private Task OnFileStream(Stream stream)
    {
        //using MiniExcelLibs
        //private string contentsExcel;
        //var rows = stream.Query().ToList();
        //rows.ForEach(a=> contentsExcel += Environment.NewLine + string.Join(" | " , a ));
        StateHasChanged();
        return Task.CompletedTask;
    }
    
    private Task OnDirectory(List<string> dirs)
    {
        if (dirs == null || !dirs.Any()) return Task.CompletedTask;
        contents += "Dir:" + Environment.NewLine;
        contents += dirs.First() + Environment.NewLine;
        foreach (var item in dirs.Skip(1).OrderByDescending(a => a.StartsWith("+")).ThenBy(a => a))
        {
            contents += item + Environment.NewLine;
        }
        StateHasChanged();
        return Task.CompletedTask;
    }


} 

Blazor 组件

条码扫描 ZXingBlazor nuget stats

图片浏览器 Viewer

手写签名 SignaturePad

定位/持续定位 Geolocation

屏幕键盘 OnScreenKeyboard

百度地图 BaiduMap

谷歌地图 GoogleMap

蓝牙和打印 Bluetooth

PDF阅读器 PdfReader

文件系统访问 FileSystem

光学字符识别 OCR

电池信息/网络信息 WebAPI

文件预览 FileViewer

视频播放器 VideoPlayer

图像裁剪 ImageCropper

视频播放器 BarcodeGenerator

AlexChow

今日头条 | 博客园 | 知乎 | Gitee | GitHub

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on BootstrapBlazor.FileSystem:

Package Downloads
BlazorShared

BlazorMaui , 整合Blazor,BootstrapBlazor UI组件库,Maui的共享跨平台工程示例共享库

BootstrapBlazor.Densen.All

Blazor 组件懒人包

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on BootstrapBlazor.FileSystem:

Repository Stars
densen2014/BlazorMaui
用 c # 和 Razor 创建本机移动应用和桌面应用。使用 Blazor.BB.Maui,可以快速开发共享代码库运行于 Windows (Winforms/WPF/UWP)、Android、iOS、macOS 的应用。
Version Downloads Last Updated
10.0.0 369 11/12/2025
9.0.0 340 1/21/2025
8.0.1 584 12/9/2023
8.0.0 353 11/15/2023
7.0.2 1,980 12/7/2022
7.0.1 919 11/30/2022
7.0.0 792 11/9/2022
6.0.0 793 10/13/2022