using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.IO;
namespace BLWWSCore.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        private readonly IWebHostEnvironment _environment;

        public ValuesController(IWebHostEnvironment environment)
        {
            _environment = environment;
        }
        [HttpGet()]
        public void Index()
        {
            // 获取项目根目录
            string contentRootPath = _environment.ContentRootPath;

            // 组合完整路径
            string directoryPath = Path.Combine(contentRootPath, "pic");
            string filePath = Path.Combine(directoryPath, "1.txt");
            System.IO.File.WriteAllText(filePath, "11111111111");
        }
    }
}
