***************************** test.asp *****************************
<%
Function getRND(highN, lowN)
Dim intVal
Randomize
intVal = int((highN-lowN+1)*rnd+lowN)
getRND = intVal
End Function
dblV = getRND(999999,100000)
Response.Cookies("q") = Cstr(dblV)
tmp = CreateObject("Scriptlet.Typelib").guid
tmp = Replace(Replace(tmp,"{",""),"}","")
%>
<%=dblV%>
<hr size="1" color="c0c0c0">
<img src="1.aspx?tmp=<%tmp%>" width="400" height="97">
***************************** 1.aspx *****************************
<% @Page language="C#" Debug="true" %>
<% @ Import Namespace="System.Drawing"%>
<% @ Import Namespace="System.Drawing.Imaging"%>
<% @ Import Namespace="System.Drawing.Drawing2D"%>
<% @ Import Namespace="System.Drawing.Text"%>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
int width = 200;
int height = 200;
String strV;
strV = (String)Request["q"];
String Filename = Server.MapPath("news2.jpg");
System.Drawing.Image gf = System.Drawing.Image.FromFile(Filename);
Graphics g = Graphics.FromImage(gf);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.TextRenderingHint = TextRenderingHint.AntiAlias;
g.DrawString(strV, new Font("verdana",35,FontStyle.Bold),Brushes.Orange, new PointF(40,25));
Response.ContentType = "image/gif";
gf.Save(Response.OutputStream, ImageFormat.Gif);
g.Dispose();
gf.Dispose();
}
</script>
***************************** 그림파일 (news2.jpg) ***************************** 
'.net' 카테고리의 다른 글
| 자바스크립트에서 비하인드 소스의 함수쓰기 (0) | 2007.05.03 |
|---|---|
| ASP.NET의 정규식 (0) | 2007.05.03 |
| ASP.NET 응용 프로그램에서 폼 기반 인증 구현 (1) | 2007.05.03 |
| ASP.NET에서 오류 보고 페이지를 만드는 방법 (0) | 2007.05.03 |
| ASP.NET에서 웹 서버에 파일 업로드 (1) | 2007.05.03 |