【转】asp仿百度文库、豆丁doc转换(flashpaper)

【转】asp仿百度文库、豆丁doc转换(flashpaper)
 
  asp仿百度文库、豆丁doc转换(flashpaper)环境:
flashpaper2.2版
win2008
IIS7

步骤:
1.文件夹权限改为everyone完全控制,虚拟主机应用程序池为Classic那个

2.安装flashpaper2.2版,安装好后会出现一个虚拟打印机Macromedia
FlashPaper

3.安装office2007,adobe
reader

4.在cmd命令下测试看能否转化文件

D:\Wwwroot\OnlinePaper\FlashPaper2.2\FlashPrinter.exe
D:\Wwwroot\OnlinePaper\plan.doc -o
D:\Wwwroot\OnlinePaper\plan.swf

如果测试生成了plan.swf则环境已经搭建好了

5.写测试asp代码

FlashPaperPath=Server.mappath("\FlashPaper2.2\FlashPrinter.exe")
strUrls
= Server.mappath("\1.doc")
toswf =
Server.mappath("\1.swf")
'response.write FlashPaperPath
Set WshShell =
server.CreateObject("Wscript.Shell")
IsSuccess = WshShell.Run
(FlashPaperPath+" "+strUrls+" -o "+toswf,1,true)
Response.write
IsSuccess
if IsSuccess = 0 Then
Response.Charset="GBK"
Response.write "
命令成功执行!"
else
Response.Charset="GBK"
Response.write "
命令执行失败!权限不够或者该程序无法运行"
end if
   

 

仿上面做的修改,但未做测试

protected void Page_Load(object sender, EventArgs e)
    {
        FlashPaperPath = Server.mappath(@"\FlashPaper2.2\FlashPrinter.exe");
        strUrls = Server.mappath(@"\1.doc");
        toswf = Server.mappath(@"\1.swf");
        //'response.write FlashPaperPath
        Set WshShell = server.CreateObject("Wscript.Shell");
        IsSuccess = WshShell.Run(FlashPaperPath + " " + strUrls + " -o " + toswf, 1, true);
        Response.Write(IsSuccess);
        if (IsSuccess = 0)
        {
            Response.Charset = "GBK";
            Response.write("命令成功执行!");
        }
        else
        {
            Response.Charset = "GBK";
            Response.write("命令执行失败!权限不够或者该程序无法运行");
        }
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值