`

C#使用PDF控件打开PDF

    博客分类:
  • VS
 
阅读更多
        private void button2_Click(object sender, EventArgs e)
        {
            if (pdfpath.Equals(""))
            {
                MessageBox.Show("请先选择要查看的文件", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                if (File.Exists(pdfpath))
                {
                    axAcroPDF1.LoadFile(pdfpath);
                }
                else
                {
                    MessageBox.Show("文件不存在", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    axAcroPDF1.LoadFile(path+"xls\\404.pdf");
                }
            }
        }

 注:安装AdbeRdr11000_zh_CN11.0.0.379.1410747856.exe阅读器,并添加引用就可以拖拽控件使用了

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics