Esempio n. 1
0
        static void Main(string[] args)
        {
#if _DEBUG
            if (ConfigSecurity.CheckDigitalSignature() == false)
            {
                Log("Config file signature check failed. Exiting");
                return;
            }
#endif
            try
            {
                var testRun = TestRunFactory.BuildTestRun();
                testRun.Execute();
            }
            catch (NoDiscoveredDevicesException)
            {
                Log("No devices found");
            }
            catch (ConnectionFailedException)
            {
                Log("Connection to device failed");
            }
            catch (NoTargetFoundException)
            {
                Log("No target devices found");
            }

            Console.WriteLine("Press a key to exit");
            Console.ReadKey(false);
        }
        private void SecureStringButton_Click(object sender, EventArgs e)
        {
            // how to encrypt connection string
            var result = ConfigSecurity.EncryptString(ConfigSecurity.ToSecureString(
                                                          ConnectionStrings["ConnectionString"].ConnectionString));

            Console.WriteLine(result);

            // how to decrypt connection string
            var unSecure = ConfigSecurity.DecryptString(result);

            Console.WriteLine(ConfigSecurity.ToInsecureString(unSecure));
        }