无法打开文件。 [英] could not open the file.

查看:76
本文介绍了无法打开文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


i创建了一个应用程序,将文件上传到文件夹,然后从该文件夹中获取文件并将其转换为图像。

这里是代码

hi
i have created an app that uploads files to a folder and then takes the files from that folder and convert it to images.
here is the code

if (FileUpload1.HasFile)
        {
          
            string file = System.IO.Path.GetFullPath(FileUpload1.PostedFile.FileName);
            string filname = FileUpload1.PostedFile.FileName;
//UPLOADS THE FILE INTO THE FOLDER
            FileUpload1.PostedFile.SaveAs(Server.MapPath("~\\NewFolder1\\") + FileUpload1.FileName);
//TAKES THE PATH and file
            string strPath = Server.MapPath(Request.ApplicationPath) + "~/NewFolder1/" + filname;
//assign the file to ppt
 ApplicationClass pptApplication = new ApplicationClass();
            Presentation pptPresentation = pptApplication.Presentations.Open(strPath, MsoTriState.msoFalse,
            MsoTriState.msoFalse, MsoTriState.msoFalse);

            var slides = new List<string>();
            targetPath = Server.MapPath("~/NewFolder1/");
            targetPath += "\\{0}";
            for (var i = 1; i <= pptPresentation.Slides.Count; i++)
            {
             .
             .
</string>



但是当我运行应用程序时它会出现以下错误。

System.Runtime.InteropServices.COMException:PowerPoint无法打开文件。

介绍pptPresentation = pptApplication.Presentations.Open(strPath,MsoTriState.msoFalse ....



请告诉我哪里是问题和我需要纠正的问题


but when i run the app it gives the follwoing error.
System.Runtime.InteropServices.COMException: PowerPoint could not open the file.
Presentation pptPresentation = pptApplication.Presentations.Open(strPath, MsoTriState.msoFalse....

please tell me where is the problem and what i need to correct

推荐答案

I am having the same issue in my applictaion. Where you able to find a solution for this issue.
Thanks in advance for your help,


这篇关于无法打开文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆