Пример #1
0
        // チャンネルのプロパティ
        private void channelProparity()
        {
            if (channelIndex < 0 || channelIndex >= channelArray.Count)
            {
                return;
            }

            ChatChannel cc = (ChatChannel)channelArray[channelIndex];

            ChannelPropertyForm dlg = new ChannelPropertyForm();
            dlg.TextBoxKey.Text         = cc.Key;
            dlg.TextBoxPath.Text        = cc.ChannelPath;
            dlg.TextBoxChannelName.Text = cc.ChannelName;
            dlg.TextBoxName.Text        = cc.NickName;
            dlg.TextBoxLogPath.Text = cc.LogPath;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                cc.Dispose();
                cc = new ChatChannel(dlg.TextBoxChannelName.Text, dlg.TextBoxName.Text, dlg.TextBoxPath.Text, dlg.TextBoxKey.Text, dlg.TextBoxLogPath.Text);
                channelArray[this.channelIndex] = cc;

                saveConfiguration();
                updateChannelList();
                updateView();
            }
            dlg.Dispose();
        }
Пример #2
0
        // 設定読出
        private void loadConfiguration()
        {
            Microsoft.Win32.RegistryKey regkey3 = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(@"Software\Ryuz\NekoChat\options\");
            this.keywords = (string)regkey3.GetValue("keywords", "");
            this.keywordWindowPopup  = ((int)regkey3.GetValue("keyword-window-popup", 0) != 0);
            this.keywordTaskbarBlink = ((int)regkey3.GetValue("keyword-taskbar-blink", 0) != 0);

            Program.Password = CryptString.DecryptString((string)regkey3.GetValue("password", ""), registryKey);
            regkey3.Close();

            Microsoft.Win32.RegistryKey regkey2 = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(@"Software\Ryuz\NekoChat\channels\");
            int num = (int)regkey2.GetValue("num", 0);
            this.channelIndex = (int)regkey2.GetValue("current", -1);
            regkey2.Close();

            if (this.channelIndex < 0) this.channelIndex = 0;
            if (this.channelIndex >= num) this.channelIndex = num - 1;

            this.channelArray.Clear();
            for (int i = 0; i < num; i++)
            {
                ChatChannel cc;

                String keyPath = @"Software\Ryuz\NekoChat\channels\" + i.ToString();
                Microsoft.Win32.RegistryKey regkey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(keyPath);

                string path = (string)regkey.GetValue("path", "");
                string nickName = (string)regkey.GetValue("nicknemae", "");
                string channelName = (string)regkey.GetValue("channelname", "");
                string ckey = (string)regkey.GetValue("key", "");
                string log = (string)regkey.GetValue("log", "");
                String key = CryptString.DecryptString(ckey, registryKey);
                cc = new ChatChannel(channelName, nickName, path, key, log);
                this.channelArray.Add(cc);

                //閉じる
                regkey.Close();
            }

            string pass = CryptString.MakeMd5String(Program.Password + "piyo");
            if (pass != "b0e65fc9c127eefe6a57a9ef858cd9bc")
            {
                toolsToolStripMenuItem.Enabled = false;
                toolsToolStripMenuItem.Visible = false;
                return;
            }
        }
Пример #3
0
        // チャンネル追加
        private void chanelAdd()
        {
            ChannelPropertyForm dlg = new ChannelPropertyForm();
            dlg.TextBoxKey.Text = defaultChannelKey;
            dlg.TextBoxPath.Text        = "";
            dlg.TextBoxChannelName.Text = "";
            dlg.TextBoxName.Text        = Environment.UserName;
            dlg.TextBoxLogPath.Text = "";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                ChatChannel cc = new ChatChannel(dlg.TextBoxChannelName.Text, dlg.TextBoxName.Text, dlg.TextBoxPath.Text, dlg.TextBoxKey.Text, dlg.TextBoxLogPath.Text);
                this.channelIndex = channelArray.Add(cc);

                saveConfiguration();
                updateChannelList();
                updateView();
            }
            dlg.Dispose();
        }