I have developed this c# program which is hardware binded. Incase the program runs on a different hardware, then it should delete itself. This seems to be working on my 2 of my home PCs, however not on my Work PC. Can you please tell me what is the issue?
Following code is part of App.xaml.cs.
if (thisComputerLicense == decryptedLicense)
{
// Valid Hardware
// Instanciate the view you want to display and show it
MainWindow mainWindow = new MainWindow();
mainWindow.Show();
}
else
{
//Invalid hardware, delete program
MessageBox.Show("Invalid Hardware"); //This message is shown on my work computer as well
Application.Current.Shutdown();
Info.Arguments = @"/C choice /C Y /N /D Y /T 3 & Erase /f /q " +
Directory.GetCurrentDirectory();
Info.WindowStyle = ProcessWindowStyle.Minimized;
Info.CreateNoWindow = true;
Info.FileName = "cmd.exe";
Process.Start(Info);
I m running this program on windows 10 with .Net framework 4.8.