<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    <%@ Page Language="C#" AutoEventWireup="true"%>
    <%@ Import Namespace="System.Xml" %>
     CodeBehind="install.aspx.cs" Inherits="WebApplication1.fckeditor.install"
    <script type="text/C#" runat="server">
        public string basePath = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {

            basePath = Request.PhysicalApplicationPath.ToString();


        }
        public bool SettingConfig(string uploadfile)
        {
            bool state = false;
            try
            {


                //創(chuàng)建文件夾
                if (!System.IO.Directory.Exists(basePath + uploadfile))
                    System.IO.Directory.CreateDirectory(basePath + uploadfile);

                string basePathConfig = basePath + "Web.config";
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(basePathConfig); //加載你的XML文件
                XmlNode appSettings = xmlDoc.SelectSingleNode("/configuration/appSettings");//查找bookstore

                string[,] strs = new string[2, 2] { { "FCKeditor:BasePath", "/fckeditor/" }, { "FCKeditor:UserFilesPath", "/" + uploadfile + "/" } };
                for (int i = 0; i < 2; i++)
                {
                    XmlElement adds = xmlDoc.CreateElement("add");//創(chuàng)建book節(jié)點(diǎn)
                    adds.SetAttribute("key", strs[i, 0]);
                    adds.SetAttribute("value", strs[i, 1]);
                    appSettings.AppendChild(adds);
                }

                xmlDoc.Save(basePathConfig);
                state = true;
            }
            catch (Exception ex)
            {

                Response.Write(ex.Message);
            }
            return state;

        }
        public bool SetingJavaScript()
        {
            bool state = false;
            string tempContent = string.Empty;
            try
            {
                using (System.IO.StreamReader sr = new System.IO.StreamReader(basePath + "fckeditor\\fckconfig.js", System.Text.Encoding.UTF8))
                {
                    tempContent = sr.ReadToEnd();
                    sr.Close();
                }
                tempContent = tempContent.Replace("FCKConfig.DefaultLanguage  = 'en' ;", "FCKConfig.DefaultLanguage  = 'zh-cn' ;").Replace("var _FileBrowserLanguage = 'asp' ;", "var _FileBrowserLanguage = 'aspx' ;").Replace("var _QuickUploadLanguage = 'asp' ;", "var _QuickUploadLanguage = 'aspx' ;");
                using (System.IO.StreamWriter sw = new System.IO.StreamWriter(basePath + "fckeditor\\fckconfig.js", false, System.Text.Encoding.UTF8))
                {
                    sw.Write(tempContent);
                    sw.Flush();
                }
                state = true;

            }
            catch (Exception ex)
            {

                Response.Write(ex.Message);
            }

            return state;
        }
        public bool CopyFile()
        {
            try
            {
                if (System.IO.File.Exists(basePath + "bin\\FredCK.FCKeditorV2.dll"))
                    System.IO.File.Delete(this.basePath + "fckeditor\\bin\\FredCK.FCKeditorV2.dll");
                else
                    System.IO.File.Copy(this.basePath + "fckeditor\\bin\\FredCK.FCKeditorV2.dll", basePath + "bin\\FredCK.FCKeditorV2.dll");
            }
            catch (Exception ex)
            {

                Response.Write(ex.Message);
                return false;
            }

            return true;
        }

        protected void BtSave_Click(object sender, EventArgs e)
        {
            SettingConfig(this.TbUploadPath.Text);
            SetingJavaScript();
            CopyFile();
            Response.Write("success");
        }
    </script>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>無(wú)標(biāo)題頁(yè)</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
       
            上傳文件夾路徑: <asp:TextBox ID="TbUploadPath" runat="server"></asp:TextBox>
            <br />
            <asp:Button ID="BtSave" runat="server" Text="保存" style="border:1px solid"
                onclick="BtSave_Click" />
       
        </div>
        </form>
    </body>
    </html>

    posted on 2010-04-08 09:45 sanmao 閱讀(113) 評(píng)論(0)  編輯  收藏

    只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     

    常用鏈接

    留言簿(5)

    隨筆分類(lèi)

    隨筆檔案

    搜索

    •  

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 亚洲国产精品不卡在线电影| 久久久久免费看黄A片APP| 牛牛在线精品观看免费正 | vvvv99日韩精品亚洲| 亚洲熟妇AV日韩熟妇在线| 亚洲熟妇av一区| 亚洲日本乱码一区二区在线二产线| 久久亚洲AV成人无码国产| 亚洲成人激情在线| 亚洲欧洲免费视频| 亚洲精品在线视频观看| 亚洲国产中文在线二区三区免| 亚洲欧洲精品视频在线观看| 久久精品亚洲一区二区三区浴池 | 久久久久亚洲AV无码专区首| 亚洲成人免费在线| 亚洲欧洲精品视频在线观看| 亚洲综合成人婷婷五月网址| 色九月亚洲综合网| 亚洲一级片免费看| 亚洲AV无码一区二区三区牲色| 亚洲成av人片在www鸭子| 美女被吸屁股免费网站| 国产精品免费久久| 免费无码VA一区二区三区| 日韩免费一区二区三区在线播放| 免费观看的a级毛片的网站| 国产jizzjizz视频全部免费| 2048亚洲精品国产| 亚洲精品国产成人专区| 一本色道久久综合亚洲精品蜜桃冫| 久久亚洲AV成人无码国产最大| av午夜福利一片免费看久久| 一级做a爰全过程免费视频| 日本免费网址大全在线观看| 国产又长又粗又爽免费视频 | 免费人成激情视频| 亚洲AV无码乱码国产麻豆| 2020年亚洲天天爽天天噜| 国产成人亚洲精品播放器下载| 国产在线精品观看免费观看|