Working on creating a WINGET Application to provide a GUI for USMT. I want to check for Admin rights and if the program is in the right folder before the main form loads and close the application if that's not the case.
So, I create a class for this purpose so I don't have Spaghetti code in the Program class.
public static class Setup
{
public static bool IsAdministrator()
{
// Stuff
}
public static void CheckAdmin()
{
if (!IsAdministrator())
{
// Moar stuff
}
}
}
And then in the Program class, I've got this...
Setup.CheckAdmin();
But I get error IDE1007 - CheckAdmin does not exist in this context and I'm not sure what I'm missing.