• C#打开office文件,pdf文件和视频文件


    打开office文件

    1 需要从网站下载dsoframer.ocx文件

    2 把dsoframer.ocx文件复制到c:windowssystem32目录下

             开始->运行->regsvr32 dsoframer.ocx , 系统会提示DSOFramer.ocx中的DllRegisterServer成功

    3 在VS中新建项目,添加引用

    4 将该控件加载到工具箱(添加新选项)

    5 将控件拖到窗体中

       打开文件:this.axFramerControl1.Open(filepath);  

    (备注:也有人说可以用pageoffice)

    打开pdf文件

    1 在工具箱中添加新的com组件Adobe PDF Reader

    2 将控件拖动到窗体中

      打开文件:this.axAcroPDF1.LoadFile(filePath);

    打开视频文件

    1 在工具箱中添加新的com组件Windows Media Player

    2 将控件拖动到窗体中

      打开文件:this.axWindowsMediaPlayer1.URL = filePath;
                    this.axWindowsMediaPlayer1.Ctlcontrols.play();

    由于windows media player支持的格式比较少,需要下载一个解码器,我用的是K-Lite_Codec_Pack,可以很容易找到下载地址。

  • 相关阅读:
    单例 与 static
    ActiveMQ 核心概念
    Jconsole
    死锁
    document write & close
    java.nio.Buffer
    Java 线程控制(输出奇偶数)
    exist & in
    命运
    Super Jumping! Jumping! Jumping!
  • 原文地址:https://www.cnblogs.com/qxzy/p/3850237.html
Copyright © 2020-2023  润新知