-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathPrivacy.cshtml.cs
More file actions
30 lines (23 loc) · 874 Bytes
/
Privacy.cshtml.cs
File metadata and controls
30 lines (23 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace webapp01.Pages;
public class PrivacyModel : PageModel
{
private readonly ILogger<PrivacyModel> _logger;
string adminUserName = "demouser@example.com";
// TODO: Don't use this in production
public const string DEFAULT_PASSWORD = "Pass@word1";
public PrivacyModel(ILogger<PrivacyModel> logger)
{
_logger = logger;
}
public void OnGet()
{
string drive = Request.Query.ContainsKey("drive") ? Request.Query["drive"] : "C";
var str = $"/C fsutil volume diskfree {drive}:";
_logger.LogInformation($"Command str: {str}");
_logger.LogInformation("Admin" + adminUserName);
_logger.LogInformation($"User: {User.Identity?.Name}");
_logger.LogInformation($"Admin: {User.IsInRole("Admin")}");
}
}