Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

asp.net Éú³ÉÑéÖ¤ÂëÁ½¸öÀý×Ó

#region 1
private void CreateCheckCodeImage()
{
//»ñÈ¡Ëæ¼´×Ö·û´®
int number;
char code;
string checkCode = String.Empty;
System.Random random1 = new Random();
for (int i = 0; i < 5; i++)
{
number = random1.Next();
if (number % 2 == 0)
code = (char)('0' + (char)(number % 10));
else
code = (char)('A' + (char)(number % 26));
checkCode += code.ToString();
}
//»­Í¼
System.Drawing.Bitmap image = new System.Drawing.Bitmap((int)Math.Ceiling((checkCode.Length * 13.0)), 24);
Graphics g = Graphics.fromImage(image);
try
{
//Éú³ÉËæ»úÉú³ÉÆ÷
Random random = new Random();
//Çå¿ÕͼƬ±³¾°É«
g.Clear(Color.White);
//»­Í¼Æ¬µÄ±³¾°ÔëÒôÏß
for (int i = 0; i < 25; i++)
{
int x1 = random.Next(image.Width);
int x2 = random.Next(image.Width);
int y1 = random.Next(image.Height);
int y2 = random.Next(image.Height);
g.DrawLine(new Pen(Color.Gray), x1, y1, x2, y2);
}
Font font = new System.Drawing.Font("Verdana", 12, (System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic));
System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(0, 0, image.Width, image.Height), Color.Blue, Color.DarkRed, 1.2f, true);
g.DrawString(checkCode, font, brush, 2, 2);
//»­Í¼Æ¬µÄǰ¾°ÔëÒôµã
for (int i = 0; i < 80; i++)
{
int x = random.Next(image.Width);
int y = random.Next(image.Height);
image.SetPixel(x, y, Color.fromArgb(random.Next()));
}
//»­Í¼Æ¬µÄ±ß¿òÏß
g.DrawRectangle(new Pen(Colo


Ïà¹ØÎĵµ£º

asp.netʹÓÃajaxºóÈçºÎÔÚ¿Í»§¶Ëµ¯³öÌáʾ¶Ô»°¿ò

//ƽ³£µ÷ÓÃjavascript·½·¨
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert'Weclome!!!');</script>");
±³¾°²»Îª°×É«µÄ·½·¨£º
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('Ìí¼Óʧ°Ü£¬ÇëÁªÏµ¼¼ÊõÔ±£¡') ......

ASP.NET MVC ×Ô¶¨Òå¹ýÂËÊôÐÔʵÏÖEnterpriseµÄlog¹¦ÄÜ

ÏÖÔ򵀮óÒµ¼¶¿ª·¢ÏîÄ¿£¬ÌرðÊÇÍøÕ¾Ò»°ã¶¼»áÓõ½log¹¦ÄÜ£¬ÏëÏë´ó²¿·Ö»áÓÃEnterprise Logging Application Block µÄ¹¦ÄÜ »òÕß×Ô¼ºÐ´Ò»¸ö×é¼þ£¬¼Ç¼ϵͳÈÕ־ʼþ£¬¸üºÃµÄ¸ú×ÙÁ˽âϵͳÔËÐÐÇé¿ö, ÏÖÓÃASP.NET MVC µÄ¹ýÂËÊôÐÔʵÏÖlog¹¦ÄÜ£¡
       ASP.NET MVCµÄfilter ÊÇÒ»¸öÊôÐÔ£¬¿ÉÒÔÓ¦Ó ......

asp.netÈý²ã½á¹¹Àý×Ó

ÕÒµ½Ò»±é½²½âÈý²ã½á¹¹±È½ÏÇå³þÒ×¶®µÄÎÄÕ£¬ÒýÓÃһϣ¬ÁôΪѧϰ¡£
Èý²ãʽ¿ª·¢ÖеIJã´Î»®·ÖÌÖÂÛ
ÏȾÙÒ»¸öÔø¾­ÔÚÄı¾ÊéÉÏ¿´µ½µÄÀý×Ó£ºÏÖÔÚÄãÏëÔÚ1Ã׿íµÄСϪÉϽ¨Ò»×ùÇÅ£¬Äã»áÔÚÉÏÃæ·Å¿éľ°å¾ÍÍêÁË¡£Èç¹ûÏëÔÚ¿íÒ»µãµÄСºÓÉϽ¨ÕâÇÅ£¬Äã¾ÍÐèÒª¼ÆËãľ²ÄÓÃÁÏ£¬¼Û¸ñµÈ£¬Èç¹ûÐèÒª±ðÈ˰ïæ£¬Ä㻹Ҫ¶àһЩͼֽʲôµÄÈñðÈËÀí½âÄãµÄÏë ......

asp.net(C#)ʵÏÖSQL2000Êý¾Ý¿â±¸·ÝºÍ»¹Ô­

asp.net(C#)ʵÏÖSQL2000Êý¾Ý¿â±¸·ÝºÍ»¹Ô­
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.Htm ......

Asp.net(C#)¶àÎļþÉÏ´«


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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ