首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

asp.net 多线程 Word下载打印解决方案

2013-03-26 
asp.net 多线程 Word下载打印每次运行到Microsoft.Office.Interop.Word.Application thisApplication ne

asp.net 多线程 Word下载打印
每次运行到  Microsoft.Office.Interop.Word.Application thisApplication = new Microsoft.Office.Interop.Word.ApplicationClass();时总会报错80070005错误,上网搜索说是Word权限设置问题,可是之前没有用线程时已经添加过<identity impersonate="true" userName="Administrator" password="1"/>,Word权限方面也设置过了,请问大侠们有没有关于多线程操作Word的实例啊,最好是能运行的,急求!

[解决办法]
没有遇到过呢...进来学习一下...顶帖子。
[解决办法]
你在服务器上打印文件?
[解决办法]
你是用什么方式进行的下载。  。 。 
如果是用流的方式下载的话。  可能是下载的时候这个文件被锁住了。   然后在打印的时候报错。 
[解决办法]
参照这个

Thread myThread = new Thread( new ThreadStart(openWord));
 SetUIVisible(false);
 myThread.IsBackground = true;
 myThread.Start();  

 void openWord()
   {                               

    this.webBrowserWord.Navigate(filePath);
    this.Invoke(new delegateSetLblVisibal(SetUIVisible), new object[] { true });
   }
void SetUIVisible(bool visible)
        {
           this.lblOpening.Text="正在打开。。。";
            this.lblOpening.Visible = !visible;
        }
[解决办法]
Thread myThread = new Thread( new ThreadStart(openWord));
 SetUIVisible(false);
 myThread.IsBackground = true;
 myThread.Start();   

 void openWord()
  {   

  this.webBrowserWord.Navigate(filePath);
  this.Invoke(new delegateSetLblVisibal(SetUIVisible), new object[] { true });
  }
void SetUIVisible(bool visible)
  {
  this.lblOpening.Text="正在打开。。。";
  this.lblOpening.Visible = !visible;
  }

热点排行