日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

.NET實(shí)現(xiàn)在網(wǎng)頁(yè)中預(yù)覽Office文件的3個(gè)方法(2)_.Net教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:asp.net中控制反轉(zhuǎn)怎么理解?
對(duì)IOC的解釋為:Inversion of control is a common characteristic of frameworks, so saying that these lightweight containers are special because they use inversion of control is like saying my car is special because it has wheels. 我想對(duì)這一概念執(zhí)行

        #region 1.02 Excel文件轉(zhuǎn)換為HTML文件 +(string sourceFileName, string targetFileName, string guid)
        /// <summary>
        /// Excel文件轉(zhuǎn)換為HTML文件
        /// </summary>
        /// <param name="sourceFileName">Excel文件路徑</param>
        /// <param name="targetFileName">目標(biāo)路徑</param>
        /// <returns>轉(zhuǎn)換是否成功</returns>
        public static bool ConvertExcelToHtml(string sourceFileName, string targetFileName)
        {
            Souxuexiao.API.Logger.info(string.Format("準(zhǔn)備執(zhí)行Excel文件轉(zhuǎn)換為HTML文件,sourceFileName={0},targetFileName={1}",sourceFileName,targetFileName));
            try
            {
                using (System.IO.Stream stream = new System.IO.FileStream(sourceFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.ReadWrite))
                {
                    Aspose.Cells.Workbook workbook = new Workbook(stream);
                    workbook.Save(targetFileName, Aspose.Cells.SaveFormat.Html);
                }
            }
            catch (Exception ex)
            {
                Souxuexiao.API.Logger.error(string.Format("Excel文件轉(zhuǎn)換為HTML文件ConvertExcelToHtml異常原因是:{0}", ex.Message));
            }
            return System.IO.File.Exists(targetFileName);
        }
        #endregion

        #region 1.03 將PowerPoint文件轉(zhuǎn)換為PDF +ConvertPowerPointToPdf(string sourceFileName, string targetFileName)
        /// <summary>
        /// 將PowerPoint文件轉(zhuǎn)換為PDF
        /// </summary>
        /// <param name="sourceFileName">PPT/PPTX文件路徑</param>
        /// <param name="targetFileName">目標(biāo)文件路徑</param>
        /// <returns>轉(zhuǎn)換是否成功</returns>
        public static bool ConvertPowerPointToPdf(string sourceFileName, string targetFileName)
        {
            Souxuexiao.API.Logger.info(string.Format("準(zhǔn)備執(zhí)行PowerPoint轉(zhuǎn)換PDF,sourceFileName={0},targetFileName={1}",sourceFileName,targetFileName));
            try
            {
                using (System.IO.Stream stream = new System.IO.FileStream(sourceFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.ReadWrite))
                {
                    Aspose.Slides.Pptx.PresentationEx pptx = new Aspose.Slides.Pptx.PresentationEx(stream);
                    pptx.Save(targetFileName, Aspose.Slides.Export.SaveFormat.Pdf);
                }
            }
            catch (Exception ex)
            {
                Souxuexiao.API.Logger.error(string.Format("將PowerPoint文件轉(zhuǎn)換為PDFConvertExcelToHtml異常原因是:{0}", ex.Message));
            }
            return System.IO.File.Exists(targetFileName);
        }
        #endregion

分享:delphi選擇文件夾例子
所需單元 示例代碼

來源:模板無憂//所屬分類:.Net教程/更新時(shí)間:2014-10-11
相關(guān).Net教程