<%@ Page Language="VB" %>
<%@ import Namespace="System.Drawing" %>
<%@ import Namespace="System.Drawing.Imaging" %>
<%@ import Namespace="System.Drawing.Drawing2D" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Private Sub Page_Load(sender As Object, e As EventArgs)
' Set the page's content type to JPEG files
' and clear all response headers.
Response.ContentType = "image/jpeg"
Response.Clear()
' Buffer response so that page is sent
' after processing is complete.
Response.BufferOutput = True
' Create a font style.
Dim rectangleFont As New Font( _
"Arial", 10, FontStyle.Bold)
' Create integer variables.
Dim height As Integer = 100
Dim width As Integer = 200
' Create a random number generator and create
' variable values based on it.
Dim r As New Random()
Dim x As Integer = r.Next(75)
Dim a As Integer = r.Next(155)
Dim x1 As Integer = r.Next(100)
' Create a bitmap and use it to create a
' Graphics object.
Dim bmp As New Bitmap( _
width, height, PixelFormat.Format24bppRgb)
Dim g As Graphics = Graphics.FromImage(bmp)
g.SmoothingMode = SmoothingMode.AntiAlias
g.Clear(Color.LightGray)
' Use the Graphics object to draw three rectangles.
g.DrawRectangle(Pens.White, 1, 1, width - 3, height - 3)
g.DrawRectangle(Pens.Aquamarine, 2, 2, width - 3, height - 3)
g.DrawRectangle(Pens.Black, 0, 0, width, height)
' Use the Graphics object to write a string
' on the rectangles.
g.DrawString("ASP.NET Samples", rectangleFont, SystemBrushes.WindowText, New PointF(10, 40))
' Apply color to two of the rectangles.
g.FillRectangle( _
New SolidBrush( _
Color.FromArgb(a, 255, 128, 255)), _
x, 20, 100, 50)
g.FillRectangle( _
New LinearGradientBrush( _
New Point(x, 10), _
New Point(x1 + 75, 50 + 30), _
Color.FromArgb(128, 0, 0, 128), _
Color.FromArgb(255, 255, 255, 240)), _
x1, 50, 75, 30)
' Save the bitmap to the response stream and
' convert it to JPEG format.
bmp.Save(Response.OutputStream, ImageFormat.Jpeg)
' Release memory used by the Graphics object
' and the bitmap.
g.Dispose()
bmp.Dispose()
' Send the output to the client.
Response.Flush()
End Sub 'Page_Load
</script>
<html >
<head>
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>
相关推荐
httpResponse . setContent ( { status : true } ) ; httpResponse . setContent ( "Everything is ok" ) ; // or httpResponse . setContent ( new Buffer ( "Something" ) ) ; // or httpResponse . setStatusCode...
python 零基础学习篇
在网上经常看见有这样的代码HttpResponse response = HttpContext.Current.Response;现在我也来说说这几个东东是什么吧
HttpResponse response = client.execute(get); HttpEntity entity = response.getEntity(); InputStream is = entity.getContent(); pic = BitmapFactory.decodeStream(is); } catch (ClientProtocolException...
if(httpResponse.getStatusLine().getStatusCode()==200){//连接成功 String result = EntityUtils.toString(httpResponse.getEntity());//获得资源 result = result.replaceAll("\r\n|\n\r|\r|\n", "");...
配置JDK: XP:右键"我的电脑"("属性"("高级"("环境变量" WIN7:右键"我的电脑"("高级系统设置"("环境变量" 新建系统变量: JAVA_HOME,C:\Program Files (x86)\Java\jdk1.6.0_18(JDK安装目录)。 PATH,%JAVA_...
import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache....
import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache....
org.apache.HTTP需要的jar包,常用于Web开发,比如JSP+Servlet的学习,SSM\SSH等
return HttpResponse('%s("我要上鸭王")' %(callback,)); # javascript function submitJsonp4() { $.ajax({ url: 'http://127.0.0.1:9000/xiaokai.html', type: 'GET', //写post 没有用 只能发get dataType: ...
1.浏览器中输入网站地址:172.20.52.163:20014 ...代码实现 server.py #!/usr/bin/python ...def HttpResponse(header,whtml): f = file(whtml) contxtlist = f.readlines() context = ''
背景 ...1.浏览器中输入网站地址:172.20.52.163:20014 ...代码实现 server.py #!/usr/bin/python ...def HttpResponse(header,whtml): f = file(whtml) contxtlist = f.readlines() context = ''.
import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache....
接受的响应对象,具有statusCode属性,第一参数,并返回true ,如果状态码是内2xx范围,否则返回false 。 可选地,它将回调作为第二个参数,仅当响应不成功时才使用错误对象调用它。 错误设置了statusCode 、 ...
HttpResponse Imap JavaKeyStore JsonArray JsonObject Jwe Jws Jwt KeyContainer Log MailMan Mailboxes MessageSet Mht Mime Ntlm OAuth1 OAuth2 Pem Pfx PrivateKey Prng PublicKey Rest Rsa Rss SFtp SFtpDir ...
在Cookie介绍中 我们了解到Cookie是基于Set Cookie响应头和Cookie请求头工作的 服务器通过response对象的addHeader 方法将cookie发送给浏览器 然后浏览器通过Cookie请求头将cookie再送回服务器
方法说明: 结束响应,告诉客户端所有消息已经发送。当所有要返回的内容发送完毕时,该函数必须被调用一次。 如何不调用该函数,客户端将永远处于等待状态。 语法: 代码如下: response.end([data], [encoding]) ...
String strResult = EntityUtils.toString(httpResponse.getEntity()); Log.e("WeiboKu", "strResult :"+strResult); return strResult; } else { Log.e("WeiboKu", "strResult Error:"+statusCode); return...
import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.ParseException; import org.apache.http.client.ClientProtocolException; import org.apache....