我在用Word.Application、Excel.Application将Word、Excel转换至Html出错错误,如下:*********************************************************************************
拒绝访问。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.UnauthorizedAccessException: 拒绝访问。 ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
************************************************************************************在 Web.config 中配置 <identity impersonate="true"/> 上传到服务器,在转换时提示输入用户名、密码,真是头疼。
请问哪位高手有没有一种更好了方法可以解决这个问题。
拒绝访问。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.UnauthorizedAccessException: 拒绝访问。 ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
************************************************************************************在 Web.config 中配置 <identity impersonate="true"/> 上传到服务器,在转换时提示输入用户名、密码,真是头疼。
请问哪位高手有没有一种更好了方法可以解决这个问题。
解决方案 »
- 循环输出的问题
- 庖丁解牛:纵向切入 NO 4 writer.AddAttribute("Key", this.Value);
- 需要爱情??????????????????????
- 如何判断DataGrid中如果没有数据的话,显示“本栏目没有数据”,有数据的话则不显示。改怎么写?
- VS2005的"Publish Web Site"的奇怪现象,求解
- 如何实现将dbf文件的数据放到数据库里
- 自定义控件PostBack不能改变的问题
- 关于用户控件隐藏后又出现,,在html中找不到这个控件相关元素的问题
- DateGrid的两上问题?
- 我有2个问题,知道的帮帮我,谢谢!
- treeview树型控件的问题
- asp页面跟aspx页面session传值问题
Word.Document mydoc;
Word.Application word_app=new Word.ApplicationClass();
word_app.Visible=true;
word_app.Documents.Add(ref oMissing,ref oMissing,ref oMissing,ref oMissing);
mydoc=word_app.ActiveDocument;
object FileName=MapPath("../files/")+"11.doc";
word_app.Documents.Open(ref FileName,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing);object missing = System.Reflection.Missing.Value;
object fileName = MapPath("../files/22.html");
object Format = (int)Word.WdSaveFormat.wdFormatHTML;
mydoc.SaveAs(ref fileName, ref Format,ref missing, ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing, ref missing,ref missing,ref missing,ref missing,ref missing,ref missing);
mydoc.Close(ref oMissing,ref oMissing,ref oMissing);
word_app.Quit(ref oMissing,ref oMissing,ref oMissing);
太感谢了,不过在转换Word时出现错误,提示“内存不足,请现在保存文档”,在转换Excel时一切正常