无法投射物体 [英] Unable to cast an object

查看:85
本文介绍了无法投射物体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在一个窗口中显示多个图像文件.
我将在arraylist的帮助下存储文件,之后我将在arraylist的帮助下检索文件.
我正在使用binarywrite显示多个图像,但显示出无法投射对象的错误.

您能帮忙解决这个问题吗?

这是我的代码:

For i = 0 To fname1.Count - 1
                Response.Clear()
                Response.ContentType = "image/JPEG"
                Response.BinaryWrite(fname1(i))
                Response.Flush()
                Response.End()
            Next



在此先谢谢您.将文件名发送到页面...

查看File.ReadAllBytes,然后尝试发送该文件...




我也尝试过,但是在此过程中没有显示图像文件.

预先感谢


Hi,

I want to display the multiple image file in a single window.
I am storing the files with the help of arraylist after that i am retrieving the file with the help of arraylist.
I am using binarywrite to display multiple images but it show the error like unable to cast object.

Can you Please help to resolve this solution.

This is my code:

For i = 0 To fname1.Count - 1
                Response.Clear()
                Response.ContentType = "image/JPEG"
                Response.BinaryWrite(fname1(i))
                Response.Flush()
                Response.End()
            Next



Thanks in Advance.

解决方案

I''m just guessing here, but I don''t think that would work anyway: you probably want to read the file rather than sending the file name to the page...

Look at File.ReadAllBytes, and try sending that instead...


Hi,

I tried that too, but in this it not showing the image file.

Thanks in advance


这篇关于无法投射物体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆