Adding
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Serilog;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ReserveManagementSystemUI.Helpers
|
||||
{
|
||||
public class IEHelpers
|
||||
{
|
||||
private IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
public IEHelpers(IHttpContextAccessor httpContextAccessor)
|
||||
{
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
public bool IsIE()
|
||||
{
|
||||
string userAgent = _httpContextAccessor.HttpContext.Request.Headers["User-Agent"];
|
||||
return userAgent.Contains("MSIE") || userAgent.Contains("Trident");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user