Exemplo n.º 1
0
        public void LoadUrl()
        {
            // Uri rulpaht = new Uri("http://www.kanng.net");

            //webBrowser1.Url = rulpaht;

            richTextBox1.Text = KanngHelper.SingleKanng(LoadPath).ReadAllText();


            List <UrlModel> urlModel = UrlXmlIO.ReadAllUrl();

            if (urlModel != null)
            {
                foreach (UrlModel model in urlModel)
                {
                    this.urlPatte1 = new UrlPatte();

                    urlPatte1.SetModel(model.guid, model.url, model.name);
                    //
                    // urlPatte1
                    //
                    this.urlPatte1.Cursor   = System.Windows.Forms.Cursors.Hand;
                    this.urlPatte1.Location = new System.Drawing.Point(3, 3);
                    this.urlPatte1.Name     = "urlPatte1";
                    this.urlPatte1.Size     = new System.Drawing.Size(87, 51);
                    this.urlPatte1.TabIndex = 3;

                    this.flowLayoutPanel1.Controls.Add(this.urlPatte1);
                }
            }
        }
Exemplo n.º 2
0
        private void  除ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool isSuccess = UrlXmlIO.DeleteNode(urlModel.guid);

            MessageBox.Show("XML节点删除成功:" + isSuccess.ToString());
            this.Hide();
            this.Dispose();
        }
Exemplo n.º 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            List <UrlModel> urlModel = UrlXmlIO.ReadAllUrl();

            if (urlModel != null)
            {
                foreach (UrlModel model in urlModel)
                {
                    System.Diagnostics.Process.Start(model.url);
                }
            }
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim() == "" || textBox2.Text.Trim() == "")
            {
                return;
            }

            string guid = Guid.NewGuid().ToString().Replace("-", "");

            if (urlModel != null)
            {
                guid = urlModel.guid;
                bool rlb = UrlXmlIO.UpdateNode(textBox2.Text, textBox1.Text, guid, txt_UserName.Text, txt_Pwd.Text);
                if (rlb)
                {
                    MessageBox.Show("更新成功!");
                }

                StartProccess startFrom = (StartProccess)CheckMdiFormIsOpen("StartProccess");
                UrlModel      model     = new UrlModel();
                model.guid     = guid;
                model.name     = textBox2.Text;
                model.url      = textBox1.Text;
                model.username = txt_UserName.Text.Trim();
                model.password = txt_Pwd.Text.Trim();

                startFrom.updateControl(model);
            }
            else
            {
                bool rlb = UrlXmlIO.Create(textBox2.Text, textBox1.Text, guid, txt_UserName.Text, txt_Pwd.Text);
                if (rlb)
                {
                    MessageBox.Show("添加成功!");
                }

                StartProccess startFrom = (StartProccess)CheckMdiFormIsOpen("StartProccess");
                UrlModel      model     = new UrlModel();
                model.guid     = guid;
                model.name     = textBox2.Text;
                model.url      = textBox1.Text;
                model.username = txt_UserName.Text.Trim();
                model.password = txt_Pwd.Text.Trim();
                startFrom.addControl(model);
            }

            this.Close();
        }
Exemplo n.º 5
0
        private void button3_Click(object sender, EventArgs e)
        {
            List <UrlModel> urlModel = UrlXmlIO.ReadAllUrl();

            if (urlModel != null)
            {
                foreach (UrlModel model in urlModel)
                {
                    if (model.url.ToLower().StartsWith("https") || model.url.ToLower().StartsWith("http"))
                    {
                        System.Diagnostics.Process.Start(model.url);
                    }
                    else
                    {
                        System.Diagnostics.Process.Start("http://" + model.url);
                    }
                }
            }
        }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            string guid = Guid.NewGuid().ToString().Replace("-", "");

            bool rlb = UrlXmlIO.Create(textBox1.Text, guid);

            if (rlb)
            {
                MessageBox.Show("添加成功!");
            }

            StartProccess startFrom = (StartProccess)CheckMdiFormIsOpen("StartProccess");
            UrlModel      model     = new UrlModel();

            model.guid = guid;
            model.name = textBox1.Text;
            model.url  = textBox1.Text;
            startFrom.addControl(model);
            this.Close();
        }