问题创建后打开PDF [英] Problem To open PDF after create

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

问题描述

你好朋友

创建后,我有一个打开PDF文件的问题.

我正在创建一个pdf文件,并将其存储在文件夹中,然后直接打开该文件,但是它给出了错误,例如

指定的可执行文件不是有效的win32应用程序

这是代码:

Hello friends

i have one problem for open an PDF file after create.

i am create an pdf file and store in folder and after direct open that but it give error like

The Specified Executable is not a valid win32 application

here is code :

private static void DisplayLabel(string labelFileName)
    {
        System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
        System.Diagnostics.ProcessStartInfo myinfo = new System.Diagnostics.ProcessStartInfo(labelFileName);
        myinfo.UseShellExecute = false;
        myinfo.RedirectStandardOutput = true;
        myProcess.StartInfo = myinfo;
        myProcess.Start();

        myProcess.StandardOutput.ReadToEnd();
        myProcess.WaitForExit();
    }




[edit]添加了代码块-OriginalGriff [/edit]




[edit]Code block added - OriginalGriff[/edit]

推荐答案

如果这确实是ASP.NET,则除非在开发中,否则将无法正常工作反正.
C#代码在后台代码中运行-即在SERVER上.因此,任何运行的进程都将在服务器上执行,而不是在客户端上执行,因此对用户不可见(以及使Web服务器管理员烦恼)
当客户端和服务器在同一台计算机上时,它似乎可以在开发中工作,但在投入生产时会失败.

如果这不是基于Web的,则需要检查文件名并确保其包含扩展名,并且已注册PDF文件阅读器.
If this is really ASP.NET, then that isn''t going to work, except in development anyway.
C# code runs in the codebehind - i.e. on the SERVER. So any process that is run will execute on the Server, not the Client and thus be invisible to the user (as well as annoying the heck out of your web server administrator)
It may appear to work in development, when the same computer is the client and the server, but will fail when you go to production.

If this isn''t web based, then you need to check the file name and make sure it includes the extension, and that a PDF file reader are registered.


这篇关于问题创建后打开PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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