/// <summary>
        /// 模板
        /// </summary>
        /// <param name="N"></param>
        /// <returns></returns>
        public string GetXML_MODEL(int N)
        {
            MusicMsgData CMsgData = new MusicMsgData();
            CMsgData.Description = "音乐描述";
            CMsgData.Title = "音乐标题";
            CMsgData.MusicUrl = "音乐URL";
            CMsgData.HQMusicUrl = "高品质音乐URL";

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

            try
            {
                string PathFile = System.IO.Path.Combine(Server.MapPath("~"), "USER_DIR\\sysuser\\MyPost\\voc\\" + WeTextBoxFive.Text.Trim() + ".dll"); //图文 关键词回复目录);

                MusicMsgData mData = new MusicMsgData
                {
                    Description =WeTextBoxSix.Text,
                    Title = WeTextBoxSix.Text,//+ URLMP3,
                    MusicUrl =txt0.Text,// @"http://news.iciba.com//admin//tts//2014-03-18.mp3",
                    HQMusicUrl =txt1.Text//"http://www.0951uc.com/%E9%9D%92%E6%98%A5%E6%A0%A1%E5%9B%AD"
                };

                mData.SaveFile(PathFile);
               // File.WriteAllText(PathFile, WeTextBoxOne.Text, System.Text.Encoding.UTF8);

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

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

            }
            catch
            {
                Label1.Text = "保存失败,关键字中不能有特殊字符";
            }
        }
        protected void FileManager1_ExecuteCommand(object sender, ExecuteCommandEventArgs e)
        {
            if (Page.IsCallback)
            {
                e.ClientScript = "alert('Use ExecuteCommand event to handle your custom command.\\nCommandName=" + e.CommandName +
                                 "\\nItem=" + e.Items[0].VirtualPath + "')";
            }
            else
            {
                if (e.CommandName == "EditText")
                {
                    if (e.Items.Count == 0)
                        return;

                    FileManagerItemInfo item = e.Items[0];
                    ViewState["EditDocumentPath"] = item.PhysicalPath;

                    WeTextBoxFive.Text = ClassLibraryWeiBao.ClassWeiWeiXin.GetFileName(item.PhysicalPath);

                    MusicMsgData mData = new MusicMsgData();
                    mData.LoadFile(item.PhysicalPath);

                    WeTextBoxSix.Text = mData.Description;
                    WeTextBoxSix.Text = mData.Title;
                    txt0.Text = mData.MusicUrl;
                    txt1.Text = mData.HQMusicUrl;

                    Label1.Text = "";
                    FileManager1.Visible = false;
                    TextEditor.Visible = true;
                }
            }
        }
示例#4
0
    /// <summary>
    /// 从 3个 系统关键词路径中寻找关键词匹配
    /// </summary>
    /// <param name="SysPath">系统路径</param>
    /// <param name="KeyWord">关键字</param>
    /// <param name="host">url基地址</param>
    /// <param name="timestr"> 时间戳</param>
    /// <returns></returns>
    public static RepMsgData GetMySetDataG(string SysPath, string KeyWord, string host , string timestr)
    {
        string NP_IMG = System.IO.Path.Combine(SysPath, "USER_DIR\\SYSUSER\\MyPost\\IMG\\" + KeyWord + ".dll");
        string NP_TXT = System.IO.Path.Combine(SysPath, "USER_DIR\\SYSUSER\\MyPost\\TXT\\" + KeyWord + ".dll");
        string NP_VOC = System.IO.Path.Combine(SysPath, "USER_DIR\\SYSUSER\\MyPost\\VOC\\" + KeyWord + ".dll");

        if (System.IO.File.Exists(NP_IMG))
        {
            TypeMsg = 1;
            NewsMsgData C = new NewsMsgData();

            C.LoadFile(NP_IMG);

            if (C.Items.Count == 1)
            {

                var X = C.Items[0];
                X.PicUrl = ClassLibraryWeiBao.ClassWeiWeiXin.GetUrlPath(X.PicUrl, host).Replace("<%ID%>", timestr).Replace("<%id%>", timestr);

                if (X.Url.Trim() == "")
                {
                    //生成一个指向 本关键词中设置的url
                    string URL = "cmd/tuwen.aspx?w=" + KeyWord + "&t=" + X.Title.Trim();

                    X.Url = ClassLibraryWeiBao.ClassWeiWeiXin.GetUrlPath(URL, host);
                }
                else
                {
                    X.Url = ClassLibraryWeiBao.ClassWeiWeiXin.GetUrlPath(X.Url, host).Replace("<%ID%>", timestr).Replace("<%id%>", timestr);
                }

                X.Description = ClassLibraryWeiBao.ClassWeiWeiXin.NoHTML(X.Description);

            }
            else
            {
                for (int i = 0; i < C.Items.Count; i++)
                {
                    var X = C.Items[i];
                    X.PicUrl = ClassLibraryWeiBao.ClassWeiWeiXin.GetUrlPath(X.PicUrl, host).Replace("<%ID%>", timestr).Replace("<%id%>", timestr);

                    if (X.Url.Trim() == "")
                    {
                        //生成一个指向 本关键词中设置的url
                        string URL = "cmd/tuwen.aspx?w=" + KeyWord + "&t=" + X.Title.Trim();

                        X.Url = ClassLibraryWeiBao.ClassWeiWeiXin.GetUrlPath(URL, host);
                    }
                    else
                    {
                        X.Url = ClassLibraryWeiBao.ClassWeiWeiXin.GetUrlPath(X.Url, host).Replace("<%ID%>", timestr).Replace("<%id%>", timestr);
                    }
                    X.Description = "";
                }
            }

            return C;
        }

        if (System.IO.File.Exists(NP_TXT))
        {
            TypeMsg = 2;
            TextMsgData C = new TextMsgData();
            C.LoadFile(NP_TXT);

            return C;
        }

        if (System.IO.File.Exists(NP_VOC))
        {
            TypeMsg = 3;
            MusicMsgData C = new MusicMsgData();
            C.LoadFile(NP_VOC);

            C.HQMusicUrl = ClassLibraryWeiBao.ClassWeiWeiXin.GetUrlPath(C.HQMusicUrl, host).Replace("<%ID%>", timestr).Replace("<%id%>", timestr);
            C.MusicUrl = ClassLibraryWeiBao.ClassWeiWeiXin.GetUrlPath(C.MusicUrl, host).Replace("<%ID%>", timestr).Replace("<%id%>", timestr);

            return C;
        }

        // TextMsgData XC = new TextMsgData();
        //XC.Content = "请输入正确关键字";
        return null;
    }