/// <summary> /// 模板 /// </summary> /// <param name="N"></param> /// <returns></returns> public string GetXML_MODEL(int N) { ZhuanMsgData CMsgData = new ZhuanMsgData(); CMsgData.Content = "关键字"; 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\\zhuan\\" + WeTextBoxFive.Text.Trim() + ".dll"); //图文 关键词回复目录); // File.WriteAllText(PathFile, WeTextBoxOne.Text, System.Text.Encoding.UTF8); ZhuanMsgData CMsgData = new ZhuanMsgData(); CMsgData.Content = WeTextBoxOne.Text; CMsgData.SaveFile(PathFile); 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); ZhuanMsgData CMsgData = new ZhuanMsgData(); CMsgData.LoadFile(item.PhysicalPath); string text = CMsgData.Content;// File.ReadAllText(item.PhysicalPath, System.Text.Encoding.UTF8); WeTextBoxOne.Text = text; Label1.Text = ""; FileManager1.Visible = false; TextEditor.Visible = true; } } }
/// <summary> /// 识别转义 没有的时候 返回 空 /// </summary> /// <param name="SysPath"></param> /// <param name="KeyWord"></param> /// <returns></returns> public string GetZhuanYi(string SysPath, string KeyWord) { string NP_ZHUAN = System.IO.Path.Combine(SysPath, "USER_DIR/SYSUSER/MyPost/ZHUAN/" + KeyWord + ".dll"); if (System.IO.File.Exists(NP_ZHUAN)) { ZhuanMsgData C = new ZhuanMsgData(); C.LoadFile(NP_ZHUAN); return C.Content.Trim(); } return ""; }