Beispiel #1
0
        private void btn_Encode_ItemClick(object sender, ItemClickEventArgs e)
        {
            String str = spreadsheetMain.ActiveCell.DisplayText;
            String key = DESUtil.GenerateKey();

            String[] strs = new string[] {
                "Provider=IBMDA400;Data Source=172.31.96.210;User Id=ITSDTS;Password = STD008;",
                "Data Source=srf-sql;User Id=MARS_E;Password = rs@996t!ty",
                "Data Source=ichart3d;User Id=MARS_E;Password = rs@996t!ty",
                "Data Source=ichart3d;User Id=MARS_E;Password = rs@996t!ty"
            };
            str = DESUtil.EncryptString(str, key);
            Console.WriteLine(str);
            foreach (string item in strs)
            {
                Console.WriteLine("//////////////////////");
                Console.WriteLine(item);
                Console.WriteLine(" ");
                String tmp = DESUtil.EncryptString(item, key);
                Console.WriteLine(tmp);
                Console.WriteLine(" ");
                Console.WriteLine(DESUtil.DecryptString(tmp, key));
            }
        }
Beispiel #2
0
        private void txt_Input_EditValueChanged(object sender, EventArgs e)
        {
            String input = txt_Input.Text;

            txt_Des.Text = DESUtil.EncryptString(input, DESUtil.GenerateKey());
        }