asp.net ͼƬ »Ïß
Bitmap srcImg = new Bitmap(300, 300); //Ò²¿ÉÒÔ¶ÁÈëÒ»ÕÅͼƬ
Graphics graphics = Graphics.fromImage(srcImg);
Font font = new Font("ËÎÌå", 16); //×ÖÌåÓë´óС
Brush brush = new SolidBrush(Color.Red);
graphics.DrawString("www.cftea.com", font, brush, 50, 50); //д×Ö£¬×îºóÁ½¸ö²ÎÊý±íʾλÖÃ
Pen pen = new Pen(Color.fromArgb(33, 66, 99), 10); //ÑÕÉ«Óë¿í¶È
Point[] pts = new Point[3]; //ÇúÏߵĵã
pts[0] = new Point(120, 130);
pts[1] = new Point(140, 280);
pts[2] = new Point(200, 100);
graphics.DrawCurve(pen, pts); //»ÇúÏß
srcImg.Save(Server.MapPath("example.jpg"));
graphics.Dispose();
srcImg.Dispose();
Ïà¹ØÎĵµ£º
µÚÒ»²½£ºÀýÈçÓû§¿Ø¼þ·ÅÔÚMyList.Ascx£¬È»ºóÆäControlÖ¸ÁîÊÇ£º
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ViewComment.ascx.cs" Inherits="Control_ViewComment"%>
ÕâʱºòÒѾÓÐÁËInherits£¬×Ô´øÁËClassName¾ÍÊÇÆäÃû³Æ£¬Èç¹ûûÓУ¬Ôò±ØÐë´´½¨ClassNameÊôÐÔ¡£
¼ÙÉèÆäÓй«¹²ÊôÐÔID¡£
µÚ¶þ²½£ ......
(1)asp.net ʵÏÖnÃëºóÒ³Ãæ×Ô¶¯Ìø×ª
1.
<script type="text/javascript" language="javascript">
function reloadyemian()
{
window.location.href = "javascript:history.go(-1)";
}
window.setTimeout("reloadyemian();",5000);
</script> ......
//ƽ³£µ÷ÓÃjavascript·½·¨
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert'Weclome!!!');</script>");
±³¾°²»Îª°×É«µÄ·½·¨£º
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('Ìí¼Óʧ°Ü£¬ÇëÁªÏµ¼¼ÊõÔ±£¡') ......
FileUp.aspx Ò³Ãæ
1<%@ Page language="c#" Codebehind="FileUp.aspx.cs" AutoEventWireup="false" Inherits="TestCenter.FileUp" %>
2<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
3<HTML>
4 <HEAD>
5 &l ......
1.»ñȡͼƬ¿í¶ÈºÍ¸ß¶È
1.Äú¿ÉÒÔʹÓà System.Drawing.Image Àà
System.Drawing.Image img = System.Drawing.Image.fromFile(Server.MapPath("example.gif"));
int width = img.Width;
int height = img.Height;
img.Dispose();
µ«ÊÇÕâÀïÎÒÃÇÈ´²»ÄÜÔÚµ¼ÈëÃû³Æ¿Õ¼äºóʹÓà Image& ......