<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)論排行榜

    主站蜘蛛池模板: 免费中文字幕在线观看| 亚洲色偷精品一区二区三区| 国产裸模视频免费区无码| 一级毛片免费观看不卡的| 一本一道dvd在线观看免费视频 | 免费在线观看亚洲| 亚洲黄页网在线观看| 久久水蜜桃亚洲av无码精品麻豆| 亚洲毛片网址在线观看中文字幕| 国产色婷婷精品免费视频| 无码中文在线二区免费| 亚洲一区二区三区免费视频| 中文字幕日本人妻久久久免费| 日韩电影免费在线观看网址| 色欲aⅴ亚洲情无码AV蜜桃| 国产成人亚洲综合一区| 亚洲成无码人在线观看| 亚洲黄色免费在线观看| 日韩亚洲Av人人夜夜澡人人爽| 亚洲国产日韩在线视频| 亚洲日韩乱码中文无码蜜桃臀网站 | 美女视频黄a视频全免费| 999久久久免费精品播放| 今天免费中文字幕视频| 久久国产精品成人免费| 嫩草在线视频www免费观看| 一个人看的www免费视频在线观看| 中文字幕无线码免费人妻| 久草免费福利在线| 99久久免费国产精品热| 91国内免费在线视频| 99免费在线视频| 最新国产乱人伦偷精品免费网站 | 久久午夜夜伦鲁鲁片无码免费| 黄网站免费在线观看| 久久久久国产精品免费看| 免费看又黄又无码的网站| 18pao国产成视频永久免费| 日本免费人成在线网站| 97无码免费人妻超级碰碰碰碰| 好男人看视频免费2019中文|