奇怪类型转换错误:SafeArrayTypeMismatchException

xjtufb 2004-04-25 11:57:15
异常详细信息: System.Runtime.InteropServices.SafeArrayTypeMismatchException:
指定的数组不属于需要的类型。

1 byte[] ChartPic = (byte[])chSpace.GetPicture("jpeg",600,350);
2 this.Response.BinaryWrite(ChartPic);
提示异常出在1.

很奇怪的是在XP+.net环境这个代码编译运行都没有问题
但是在2000+.net环境下编译没有问题 运行的时候出现这个问题?
是2000的原因还是这种强制转换有问题,望赐教

...全文
275 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qqchen79 2004-04-26
  • 打赏
  • 举报
回复
If you are using it in a ASP.NET page, add following in the page directive:
<%@ Page language="C#" Codebehind="xxxx.aspx.cs"
AutoEventWireup="false" Inherits="xxx.xxx" AspCompat="true"%>
xjtufb 2004-04-25
  • 打赏
  • 举报
回复
顶一下

碰到类似问题的帮忙看看

111,125

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧