70 lines
1.5 KiB
C#
70 lines
1.5 KiB
C#
using System.Net;
|
|
using System.Net.Http.Headers;
|
|
using System.Text;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Http.Features;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddControllers();
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
var app = builder.Build();
|
|
// Configure the HTTP request pipeline.
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
app.UseHttpsRedirection();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllers();
|
|
|
|
|
|
const string selfdocpath = "D:\\Web";
|
|
app.MapGet("/",(HttpContext context) =>
|
|
{
|
|
byte[] data = File.ReadAllBytes("D:\\Web\\main.html");
|
|
context.Response.Body.WriteAsync(data, 0, data.Length);
|
|
});
|
|
|
|
app.Run();
|
|
/*
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style type="text/css" >
|
|
#master
|
|
{
|
|
position:absolute;
|
|
left:50%;
|
|
bottom:0;
|
|
text-align :center;
|
|
}
|
|
</style>
|
|
</head>
|
|
<head>
|
|
<meta charset=\"utf-8\">
|
|
<title>PDB缓存服务器</title>
|
|
</head>
|
|
<body>
|
|
<h1>PDB服务</h1>
|
|
<p>这是一个与微软官方pdb服务器同步的符号文件缓存服务器</p>
|
|
<p>你可以在大陆使用这个,它拥有更快的访问速度,与更低的连接延迟</p>
|
|
<p>下面是提供服务的地址,你可以将它加入到你的环境变量(_NT_SYMBOL_PATH)</p>
|
|
<p>http://www.sym101.com/download/symbols</p>
|
|
</body>
|
|
<div id="master" >
|
|
<footer><a href= "https://beian.miit.gov.cn/" target="_blank">宁ICP备2022000729号</a></footer>
|
|
</div>
|
|
</html>
|
|
*/ |