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
Ïà¹ØÎĵµ£º
URL:
http://www.cnblogs.com/JimmyZhang/archive/2007/09/04/880967.html
ÒýÑÔ
ÎÒ²éÔĹý²»ÉÙAsp.NetµÄÊé¼®£¬·¢ÏÖ´ó¶àÊý×÷Õ߶¼ÊÇÕ¾ÔÚÒ»¸ö±È½Ï¸ßµÄ²ã´ÎÉϽ²½âAsp.Net¡£ËûÃÇÄÍÐÄ¡¢Ï¸ÖµظæËßÄãÈçºÎÒ»²½²½ÍϷſؼþ¡¢ÉèÖÿؼþÊôÐÔ¡¢±àдCodeBehind´úÂ룬ÒÔʵÏÖij¸öÌض¨µÄ¹¦ÄÜ¡£
ÕâÖÖ×ö·¨£¬Êµ¼ÊÉÏÊǻشðÁË“ÈçºÎÈ¥×ö&rd ......
À´Ô´£ºhttp://www.pccode.net/info/2010/01/25/20100125-1220.html
ʵ¼ÊÉÏEval·½·¨ÊÇTemplateControlµÄ£¬¶øSystem.Web.UI.PageºÍSystem.Web.UI.UserControl¶¼¼Ì³ÐÓÚTemplateControl£¬ËùÒÔÎÒÃÇ¿ÉÒÔÔÚPageºÍUserControlÉÏÖ±½Óµ÷Óøö·½·¨¡£
Page.Eval·½·¨¿ÉÒÔ°ï ......
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 ......
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 ......
ASP.NET²Ù×÷Êý¾Ý¿â
ͨ¹ý¶ÔADO.NETµÄ»ù±¾½²½â£¬ÒÔ¼°½²½âÁËһЩÊý¾ÝÔ´¿Ø¼þµÄ»ù±¾Ó÷¨ºó£¬±¾Õ½«½éÉÜһЩASP.NET²Ù×÷Êý¾Ý¿âµÄ¸ß¼¶Ó÷¨£¬°üÀ¨Ê¹ÓÃSQLHelper£¬ÒÔ¼°Êý¾ÝÔ´¿Ø¼þ¶ÔÊý¾ÝµÄ²Ù×÷¡£±¾ÕÂÊǶÔÇ°ÃæµÄÊý¾Ý¿â֪ʶµÄÒ»ÖÖ²¹³äºÍÌáÉý¡£
9.1 ʹÓÃADO.NET²Ù×÷Êý¾Ý¿â
ÉÏÒ»ÕÂÖнéÉÜÁËADO.NETµÄ»ù±¾¸ÅÄî¡¢ADO.NETµÄ¶ÔÏó£¬ÒÔ¼ ......