图片只显示了一半?为什么?
2007-06-12 00:30
169 查看
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Data;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Configuration;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Collections;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Web;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Web.Security;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Web.UI;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Web.UI.WebControls;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Web.UI.WebControls.WebParts;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Web.UI.HtmlControls;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Net;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.IO;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
public partial class img : System.Web.UI.Page
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
protected void Page_Load(object sender, EventArgs e)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
WebRequest request = WebRequest.Create("http://bbs.rulaionline.com/RLVerifyCode.aspx");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// If required by the server, set the credentials.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
request.Credentials = CredentialCache.DefaultCredentials;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the response.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//int Length = int.Parse(response.ContentLength.ToString());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Display the status.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Console.WriteLine(response.StatusDescription);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the stream containing content returned by the server.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Stream dataStream = response.GetResponseStream();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//int Length = 10000000;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Open the stream using a StreamReader for easy access.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//===========================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
int read=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
byte[] Content = new byte[8080];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
BinaryReader reader = new BinaryReader(dataStream);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
reader.Read(Content, 0, Content.Length);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Response.BinaryWrite(Content);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//===========================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//byte[] Content = new byte[Length];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//dataStream.Read(Content, 0, Length);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//输出到页面
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Response.BinaryWrite(Content);//图片数据
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//StreamReader reader = new StreamReader(dataStream);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Read the content.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//string responseFromServer = reader.ReadToEnd();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Display the content.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Response.Write(responseFromServer);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Response.Write(dataStream);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Cleanup the streams and the response.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
reader.Close();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dataStream.Close();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
response.Close();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
相关文章推荐
- 图片只显示了一半?为什么?
- c++builder error:显示图片时只显示了一半,没显示完整
- word图片只能显示一半
- 为什么博客里的图片都显示不出来?
- Image image = Toolkit.getDefaultToolkit().getImage("picture/bg.jpg");// 这种图片加载方法为什么要 先最小化窗口然后才会显示
- 为什么有时上载到图像库的图片不能显示
- csdn发的图片为什么不显示 测试图片
- 为什么DNN的SectionHead Control图片无法显示,也无法折叠
- 为什么我这两个ImageView所显示的图片是一样大的呢,我是想把图片设置更大点,可怎么设置都一样啊
- 为什么我在css中设定的背景图片在浏览的时候不显示?
- 为什么我淘宝的图片放大总是无法显示
- 解决 outlook2007 邮件签名里面的图片只能显示一半 (有图有真相)
- TextView显示html文件中的图片,为什么显示不出来
- 为什么图片在ie中不显示
- php图片验证码,为什么非要加上ob_clean();这句话才能正常显示呢?
- 为什么用java的URL定位资源图片需要刷新界面才能显示
- Office WORD里插入图片,嵌入型只能显示一半怎么办
- 求助高手:为什么html上背景图片会有时候会显示,有时候不显示?
- [转]为什么有的网页打开图片是从上到下逐行打开,有的则是先显示低分辨率图片再逐渐加入细节?
- 图片储存于显示的原理,为什么图片显示的时候会膨胀