Supressing Windows Alerts Programmatically
In one of my applications I have the requirement to extract resources from a DLL. I'm doing this by using the command line version of a freeware tool I found here.
It works fine, but the problem I'm seeing is that since the freeware tool isn't digitally signed, Windows throws an alert everytime I call it from my application 'Are you sure you want to run this program etc.'.
Is there anyway I can supress this alert? I'm doing nothing special to call the application, my code is below.
ProcessStartInfo pInfo = new ProcessStartInfo();
pInfo.FileName = "ResourcesExtract.exe";
pInfo.CreateNoWindow = true;
pInfo.Arguments = "/Source " + "\"" + filePath + "\"" + " /DestFolder " + "\"" + outputDirectory + "\"";
Process extractProcess = new Process();
extractProcess.StartInfo = pInfo;
extractProcess.Start();
extractProcess.WaitForExit();
Any help or ideas on how I ca开发者_Go百科n supress this alert or an alternative to this solution would be appreciated.
Thanks.
I'm guessing that you downloaded the tool from the Web somewhere.
Just remove the Zone.Identifier
ADS from the file or go into the properties and click »Unblock«.
精彩评论