Esempio n. 1
0
        protected void TreeView1_SelectedNodeChanged1(object sender, EventArgs e)
        {
            Label2.Text = TreeView1.SelectedNode.Text;

            NewsMsgData CMsgData = new NewsMsgData();
            CMsgData.LoadSet(WeTextBoxOne.Text);

            for (int i = 0; i < CMsgData.Items.Count; i++)
            {
                if (CMsgData.Items[i].Title == Label2.Text)
                {
                    TextBoxTitle.Text = CMsgData.Items[i].Title;
                    txt0.Text = CMsgData.Items[i].PicUrl;
                    TextBoxUrl.Text = CMsgData.Items[i].Url;

                    string DataHTML = "";

                    try
                    {
                        //读取文件
                        string PathFile = System.IO.Path.Combine(Server.MapPath("~"),"USER_DIR\\SYSUSER\\NEWS\\"+  CMsgData.Items[i].Url);
                      DataHTML=  System.IO.File.ReadAllText(PathFile, System.Text.Encoding.UTF8);

                    }
                    catch
                    { }

                    TextBoxEDIT.Text = DataHTML;// CMsgData.Items[i].Description;

                    break;
                }

            }
        }
Esempio n. 2
0
        protected void Button21_Click(object sender, EventArgs e)
        {
            if (Label2.Text == "")
                return;

            NewsItem myItem = new NewsItem();
             myItem.Title =  TextBoxTitle.Text ;
             myItem.PicUrl= txt0.Text  ;
             myItem.Url=TextBoxUrl.Text  ;

             string PathFile = System.IO.Path.Combine(Server.MapPath("~"),"USER_DIR\\SYSUSER\\NEWS\\"+ myItem.Url);
             System.IO.File.WriteAllText(PathFile, TextBoxEDIT.Text, System.Text.Encoding.UTF8);

             myItem.Description = "";//

            NewsMsgData CMsgData = new NewsMsgData();
            CMsgData.LoadSet(WeTextBoxOne.Text);

            for (int i = 0; i < CMsgData.Items.Count; i++)
            {

                if (CMsgData.Items[i].Title == Label2.Text)
                {
                    CMsgData.Items[i] = myItem;
                    break;
                }
            }

            WeTextBoxOne.Text = CMsgData.Getdata();

            TreeView1.Nodes.Clear();

            for (int i = 0; i < CMsgData.Items.Count; i++)
            {
                TreeView1.Nodes.Add(new TreeNode(CMsgData.Items[i].Title));
            }
            TextBoxTitle.Text = "";
            txt0.Text = "";
            TextBoxUrl.Text = "";
            TextBoxEDIT.Text = "";
            Label2.Text = "";

            Button24_Click(null, null);
        }
Esempio n. 3
0
        protected void Button23_Click(object sender, EventArgs e)
        {
            for (int j = 0; j < 10000; j++)
            {
                string Name = "新图文消息" + j.ToString("D2");
                bool IsOK=true ;

                string PathFile = System.IO.Path.Combine(Server.MapPath("~"), "USER_DIR\\SYSUSER\\NEWS\\page"+j.ToString()+".htm" );

                if (System.IO.File.Exists(PathFile) == true)
                {
                    IsOK = false;
                }
                else
                {
                    for (int i = 0; i < TreeView1.Nodes.Count; i++)
                    {
                        //节点名称  已经存在 或者 文件名已经存在
                        if (TreeView1.Nodes[i].Text == Name)
                        {
                            IsOK = false; break;
                        }
                    }
                }

                if (IsOK == true)
                {
                    string filename ="page"+   j.ToString() + ".htm";  //自动生产一个文件名

                    TreeView1.Nodes.Add(new TreeNode(Name));

                    Label2.Text = Name;

                    TextBoxTitle.Text =Name;
                    txt0.Text ="";
                    TextBoxUrl.Text = filename;
                    TextBoxEDIT.Text = "内容描述";

                    NewsItem myItem = new NewsItem();
                    myItem.Title = Name;
                    myItem.PicUrl ="";
                    myItem.Url = filename;
                    myItem.Description = "内容描述";

                    NewsMsgData CMsgData = new NewsMsgData();
                    CMsgData.LoadSet(WeTextBoxOne.Text);

                    CMsgData.Items.Add(myItem);
                    WeTextBoxOne.Text = CMsgData.Getdata();

                    return;
                }

            }
        }
        protected void TreeView1_SelectedNodeChanged1(object sender, EventArgs e)
        {
            Label2.Text = TreeView1.SelectedNode.Text;

            NewsMsgData CMsgData = new NewsMsgData();
            CMsgData.LoadSet(WeTextBoxOne.Text);

            for (int i = 0; i < CMsgData.Items.Count; i++)
            {
                if (CMsgData.Items[i].Title == Label2.Text)
                {
                    TextBoxTitle.Text = CMsgData.Items[i].Title;
                    txt0.Text = CMsgData.Items[i].PicUrl;
                    TextBoxUrl.Text = CMsgData.Items[i].Url;
                    TextBoxEDIT.Text = CMsgData.Items[i].Description;
                    Image1.ImageUrl = CMsgData.Items[i].PicUrl;
                    break;
                }

            }
        }
        protected void Button23_Click(object sender, EventArgs e)
        {
            if (TreeView1.Nodes.Count >= 10)
                return;

            for (int j = 0; j < 100; j++)
            {
                string Name = "新图文消息" + j.ToString("D2");
                bool IsOK=true ;
                for(int i=0;i<TreeView1.Nodes.Count;i++)
                {
                    if (TreeView1.Nodes[i].Text == Name)
                    {
                        IsOK = false; break;
                    }
                }

                if (IsOK == true)
                {
                    TreeView1.Nodes.Add(new TreeNode(Name));

                    Label2.Text = Name;

                    TextBoxTitle.Text =Name;
                    txt0.Text ="";
                    TextBoxUrl.Text ="";
                    TextBoxEDIT.Text = "内容描述";

                    NewsItem myItem = new NewsItem();
                    myItem.Title = Name;
                    myItem.PicUrl ="";
                    myItem.Url = "";
                    myItem.Description = "内容描述";

                    NewsMsgData CMsgData = new NewsMsgData();
                    CMsgData.LoadSet(WeTextBoxOne.Text);

                    CMsgData.Items.Add(myItem);
                    WeTextBoxOne.Text = CMsgData.Getdata();

                    Image1.ImageUrl = "";

                    return;
                }

            }
        }
        protected void Button22_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < TreeView1.Nodes.Count; i++)
            {
                if (TreeView1.Nodes[i].Text == Label2.Text)
                {
                    TreeView1.Nodes.RemoveAt(i);
                    break;
                }

            }

            NewsMsgData CMsgData = new NewsMsgData();
            CMsgData.LoadSet(WeTextBoxOne.Text);

            for (int i = 0; i < CMsgData.Items.Count; i++)
            {
                if (CMsgData.Items[i].Title == Label2.Text)
                {
                    CMsgData.Items.RemoveAt(i);

                    break;
                }

            }

            WeTextBoxOne.Text = CMsgData.Getdata();

               TextBoxTitle.Text ="";
                    txt0.Text ="";
                    TextBoxUrl.Text ="";
                    TextBoxEDIT.Text = "";
                    Label2.Text = "";

                    Button24_Click(null, null);
        }
        protected void Button21_Click(object sender, EventArgs e)
        {
            NewsItem myItem = new NewsItem();
             myItem.Title =  TextBoxTitle.Text ;
             myItem.PicUrl= txt0.Text  ;
             myItem.Url=TextBoxUrl.Text  ;
             myItem.Description= TextBoxEDIT.Text ;

            NewsMsgData CMsgData = new NewsMsgData();
            CMsgData.LoadSet(WeTextBoxOne.Text);

            bool IsSave = false;
            for (int i = 0; i < CMsgData.Items.Count; i++)
            {

                if (CMsgData.Items[i].Title == Label2.Text)
                {
                    CMsgData.Items[i] = myItem;
                    IsSave = true;
                    break;
                }
            }

            if (IsSave == false)
                CMsgData.Items.Add(myItem);

            TreeView1.Nodes.Clear();

            for (int i = 0; i < CMsgData.Items.Count; i++)
            {
                TreeView1.Nodes.Add(new TreeNode(CMsgData.Items[i].Title));
            }
            TextBoxTitle.Text = "";
            txt0.Text = "";
            TextBoxUrl.Text = "";
            TextBoxEDIT.Text = "";
            Label2.Text = "";

            WeTextBoxOne.Text = CMsgData.Getdata();
            Image1.ImageUrl = "";

            Button24_Click(null ,null );
        }
        protected void Button24_Click(object sender, EventArgs e)
        {
            if (WeTextBoxFive.Text.Trim() == "")
            {
                Label1.Text = "请输入关键字"; return;
            }

            NewsItem myItem = new NewsItem();
            myItem.Title = TextBoxTitle.Text;
            myItem.PicUrl = txt0.Text;
            myItem.Url = TextBoxUrl.Text;
            myItem.Description = TextBoxEDIT.Text;

            NewsMsgData CMsgData = new NewsMsgData();
            CMsgData.LoadSet(WeTextBoxOne.Text);

            bool IsSave = false;
            for (int i = 0; i < CMsgData.Items.Count; i++)
            {

                CMsgData.Items[i] = myItem;
                IsSave = true;
                break;

            }

            if (IsSave == false)
                CMsgData.Items.Add(myItem);

            WeTextBoxOne.Text = CMsgData.Getdata();

            try
            {
                long nX = (int)(double.Parse(WeTextBoxFive.Text) * 100000);
                long nY = (int)(double.Parse(WeTextBoxSix.Text) * 100000);

                string NAME2 = nX.ToString() + "_" + nY.ToString();   //模糊地址

                //long nX1 = (int)(double.Parse(WeTextBoxFive.Text) * 10000000);
                //long nY1 = (int)(double.Parse(WeTextBoxSix.Text) * 10000000);

                string NAME1 = WeTextBoxFive.Text.Replace(".", "V") + "_" + WeTextBoxSix.Text.Replace(".", "V"); //高精度地址

                string PathFile1 = System.IO.Path.Combine(Server.MapPath("~"), "USER_DIR\\SYSUSER\\MyPost\\location1\\" + NAME1 + ".dll"); //图文 关键词回复目录);
                File.WriteAllText(PathFile1, WeTextBoxOne.Text, System.Text.Encoding.UTF8);

                string PathFile2 = System.IO.Path.Combine(Server.MapPath("~"), "USER_DIR\\SYSUSER\\MyPost\\location2\\" + NAME2 + ".dll"); //图文 关键词回复目录);
                File.WriteAllText(PathFile2, WeTextBoxOne.Text, System.Text.Encoding.UTF8);

                FileManager1.Visible = true;
                TextEditor.Visible = false;
                Label1.Text = "保存成功!";

                FileManager1.FileViewMode = IZ.WebFileManager.Components.FileViewRenderMode.Details;

            }
            catch
            {
                Label1.Text = "保存失败,关键字中不能有特殊字符";
            }
        }