SaveInRegistery() public static method

public static SaveInRegistery ( string key, string value ) : void
key string
value string
return void
Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            CredentialHelper.SaveInRegistery(CredentialHelper.SourceRepoUserName, SourceRepoUserName.Text);
            CredentialHelper.SaveInRegistery(CredentialHelper.SourceRepoPassword, SourceRepoPassword.Text);
            CredentialHelper.SaveInRegistery(CredentialHelper.TargetRepoUserName, TargetRepoUserName.Text);
            CredentialHelper.SaveInRegistery(CredentialHelper.TargetRepoPassword, TargetRepoPassword.Text);

            this.Close();
        }
Beispiel #2
0
        private static string GetScriptName()
        {
            string script;
            SHA1   sha = new SHA1CryptoServiceProvider();

            using (var stream = File.OpenRead(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile))
            {
                var hash = BitConverter.ToString(sha.ComputeHash(stream));

                if (hash == CredentialHelper.GetFormRegistery("ConfigHash"))
                {
                    script = "UpdateSource.ps1";
                }
                else
                {
                    CredentialHelper.SaveInRegistery("ConfigHash", hash);
                    script = "CheckoutSource.ps1";
                }
            }
            return(script);
        }