C# 简单的 HTTP 静态文件服务 NS (Netnr.Serve)
NS (Netnr.Serve)
简单的 HTTP 静态文件服务
Simple HTTP static file serving
Start (启动)
启动逐个参数设置
--urls (default: http://*:713/):
--root (default: D:/site): #根目录,默认命令行启动位置
--index (default: index.html):
--404 (default: 404.html):
--suffix (default: .html):
--charset (default: utf-8):
--readonly (default: false): #只读则不能上传、删除
--auth (user:pass): #设置 Basic 授权访问
--headers (k1:v1||k2:v2):
静默带参启动
ns --urls http://*:713/--readonly true
List (列表)
curl http://localhost:713/ #列表,默认浏览器 FTP,curl 友好
curl http://localhost:713/-u user:pass #带授权
(iwr http://localhost:713/).content #PowerShell
Download (下载)
curl http://localhost:713//file.exe -O
curl http://localhost:713/dir/?zip #下载文件夹,不压缩打包目录并实时输出流
iwr http://localhost:713//file.exe -outfile file.exe #PowerShell
Upload (上传)
curl http://localhost:713/-T file.ext #上传文件
curl http://localhost:713/dir/rename.ext -T file.ext #自定义路径上传
iwr http://localhost:713/dir/rename.ext -method put -infile file.ext
Delete (删除)
curl http://localhost:713/file.ext -X delete #删除
iwr http://localhost:713/file.ext -method delete #PowerShell
Release (发布)
win-x64 NativeAOT 3.14M
https://r2.zme.ink/releases/ns-8.0.1-win-x64.exe
linux-x64 NativeAOT 7M
https://r2.zme.ink/releases/ns-8.0.1-linux-x64.aot
osx-x64 NativeAOT 5.25M
https://r2.zme.ink/releases/ns-8.0.1-osx-x64.aot
建议下载后改名为 ns
再配一个环境变量,更方便使用
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· [翻译] 为什么 Tracebit 用 C# 开发
· Deepseek官网太卡,教你白嫖阿里云的Deepseek-R1满血版
· 2分钟学会 DeepSeek API,竟然比官方更好用!
· .NET 使用 DeepSeek R1 开发智能 AI 客户端
· 刚刚!百度搜索“换脑”引爆AI圈,正式接入DeepSeek R1满血版