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

Asp.net(C#)ʵÏÖÑéÖ¤Â빦ÄÜ

н¨Ò»¸öרÃÅÓÃÀ´´´½¨ÑéÖ¤ÂëͼƬµÄÒ³ÃæValidateCode.aspx
ËüµÄºǫ́csÎļþ´úÂëÈçÏ£º
PageLoad
private void Page_Load(object sender, System.EventArgs e)
{
string checkCode = CreateRandomCode(4);
Session["CheckCode"] = checkCode;
CreateImage(checkCode);

ÆäÖÐCreateRandomCodeÊÇ×Ô¶¨ÒåµÄº¯Êý£¬²ÎÊý´ú±íÑéÖ¤ÂëλÊý
private string CreateRandomCode(int codeCount)
{
string allChar = "0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,W,X,Y,Z" ;
string[] allCharArray = allChar.Split(',');
string randomCode = "";
int temp = -1;
Random rand = new Random();
for(int i = 0; i < codeCount; i++)
{
if(temp != -1)
{
rand = new Random(i*temp*((int)DateTime.Now.Ticks));
}
int t = rand.Next(35);
if(temp == t)
{
return CreateRandomCode(codeCount);
}
temp = t;
randomCode += allCharArray[t];
}
return randomCode;

CreateImageÒ²ÊÇÒ»¸ö×Ô¶¨ÒåµÄº¯Êý£¬ÓÃÓÚÉú³Éͼ
private void CreateImage(string checkCode)
{
int iwidth = (int)(checkCode.Length * 11.5);
System.Drawing.Bitmap image = new System.Drawing.Bitmap(iwidth, 20);
Graphics g = Graphics.fromImage(image);
Font f = new System.Drawing.Font("Arial", 10, System.Drawing.FontStyle.Bold);
Brush b = new System.Drawing.SolidBrush(Color.White);
//g.FillRectangle(new System.Drawing.SolidBrush(Color.Blue),0,0,image.Width, image.Height);
g.Clear(Color.Blue);
g.DrawString(checkCode, f, b, 3, 3);
Pen blackPen = new Pen(Color.Black, 0);
Random rand = new Random();
for (int i=0;i<5;i++)
{


Ïà¹ØÎĵµ£º

C#ºÍJavaScriptµÄ¼òµ¥»¥½»

1.asp.netºô½Ðjs
   
                     Response.Write("<script language=javascript>");
              &n ......

C#Àï¶ÔxmlÎļþ½øÐÐÐÞ¸Ä,ÐÂÔö,ɾ³ý,²åÈë²Ù×÷

ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
<price>5.95</price> ......

ASP.NET·ÖÒ³·½·¨µÄÁ˽â³Ì¶È

ASP.NET·ÖÒ³·½·¨µÄÁ˽â³Ì¶È
¡¾³öÏÖÆµÂÊ¡¿
¡ï¡ï¡ï¡ï¡î
¡¾½â´ð¡¿
ASP.NET·ÖÒ³µÄ³£Ó÷½·¨ÓÐÒÔϼ¸ÖÖ¡£
q ÆôÓò¿·ÖÊý¾Ý¿Ø¼þµÄÄÚÖ÷ÖÒ³¹¦ÄÜ£¬ÈçÉèÖÃGridView¿Ø¼þµÄ“AllowPaging”ÊôÐÔΪ“true”£¬ÀàËÆµÄÊý¾Ý¿Ø¼þ»¹ÓÐDetailsViewµÈ¡£
q ͨ¹ýSQL²éѯÓï¾ä£¬ÒÔÌáȡָ¶¨²¿·ÖµÄÊý¾ÝµÄ·½Ê½Íê³É·ÖÒ³µÄ¹¦ÄÜ¡£Ò ......

ASP.NET C# URL¼ÓÃܽâÃÜ

ÐèÒªÒýÓõÄÀàÃû¿Õ¼ä
using System.Security.Cryptography;
using System.IO;
using System.text;
 
        /// <summary>
        /// ¼ÓÃÜ
        // ......

asp.netc#AccessͨÓÃÊý¾Ý·ÃÎÊÀà

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