private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
MessageBox.Show("请输入股票代码!", "错误");
return;
}
byte[] ImaByte;
ImaByte = webService.getStockImageByteByCode(textBox1.Text);
Image tempImage;
Stream imageStream = new MemoryStream(ImaByte);
//imageStream.Read(ImaByte, 0, ImaByte.Length);
tempImage = Image.FromStream(imageStream);
pictureBox1.Image = tempImage;
pictureBox1.Show();
}
谢谢了!
解决方案 »
- 关于资源的释放,听起来很简单的问题。!!
- 求助:c# 中使用 webBrowser控件 自动登陆的问题!
- 大陆与台湾windows程序数据处理问题???
- 请问,数据库里的时间字段,提取出来显示在页面上成了2005-9-26 0:00:00 ,可是我要的是2005-9-26,如何过滤?
- SQL Server Reporting Services sn
- 急,如何判断客户端的浏览器是不是支持cookies,不支持能修改它支持cookies吗
- 拖动窗体出屏幕,自定义控件出现残影,请教解决方法..
- C#即时通信
- 请问如何在ListView的subItem中添加图片?
- 对面对象的问题
- get可以接受变量吗
- 请问如何将数据库datetime字段设置为空?
byte[] ImaByte;
ImaByte = webService.getStockImageByteByCode(textBox1.Text);
Image tempImage;
Stream imageStream = new MemoryStream(ImaByte);
//imageStream.Read(ImaByte, 0, ImaByte.Length);
tempImage = Image.FromStream(imageStream);
pictureBox1.Image = tempImage;
pictureBox1.Show();
其实就是这儿不知道怎么写成C#.net Web的形式
<img src="StockImage.aspx?StockCode=<%=textBox1.Text%>" />
StockCode.aspx:
<%
string StockCode = Request.QueryString("StockCode").Trim();
if (StockCode == string.Empty)
{
Response.WriteFile("NullStock.gif");
}
else
{
byte[] ImaByte = webService.getStockImageByteByCode(StockCode);
Response.BinaryWrite(ImaByte);
}
%>