SoftwayWeb/Controllers/HomeController.cs
2024-07-30 10:00:13 +02:00

44 lines
1.2 KiB
C#

using Microsoft.AspNetCore.Mvc;
using SoftwayWeb.Models;
using System.Diagnostics;
namespace SoftwayWeb.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
return View();
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
SessionHelper helper = new SessionHelper(this);
string e = helper.GetStringValue("errMsg");
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, ErrMsg = e });
}
public FileResult Download(string file)
{
string app = "";
byte[] fileBytes = System.IO.File.ReadAllBytes(file);
var response = new FileContentResult(fileBytes, "application/octet-stream");
response.FileDownloadName = "appGesa.apk";
return response;
}
}
}