假如所在目录为download
app.UseHttpsRedirection(); app.UseStaticFiles(new StaticFileOptions() { FileProvider = new PhysicalFileProvider( Path.Combine(Directory.GetCurrentDirectory(), @"download")), RequestPath = new PathString("/download") }); app.UseRouting();