asp.net ÑéÖ¤Âë
ÑéÖ¤ÂëÓ¦Ó㺽«´úÂ븴ÖƵ½Ò³Ãæ¼´¿É£¬²¢½«Ò³ÃæµÄ·¾¶Ð´µ½Í¼Æ¬µÄurlÖбã¿ÉʹÓÃ
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.HtmlControls;
using System.Drawing;
using System.Drawing.Drawing2D; //ÒýÓõÄÃüÃû¿Ø¼þ
public partial class Image : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
CreateCheckCodeImage(GenCode(4));
}
/**//// <summary>
/// '²úÉúËæ»ú×Ö·û´®
/// </summary>
/// <param name="num">Ëæ»ú³ö¼¸¸ö×Ö·û</param>
/// <returns>Ëæ»ú³öµÄ×Ö·û´®</returns>
private string GenCode(int num)
{
//string str = "µÄÒ»ÊÇÔÚ²»ÁËÓкÍÈËÕâÖдóΪÉϸö¹úÎÒÒÔÒªËûʱÀ´ÓÃÃÇÉúµ½×÷µØÓÚ³ö¾Í·Ö¶Ô³É»á¿ÉÖ÷·¢Ä궯ͬ¹¤Ò²ÄÜϹý×Ó˵²úÖÖÃæ¶ø·½ºó¶à¶¨ÐÐѧ·¨ËùÃñµÃ¾Ê®ÈýÖ®½ø×ŵȲ¿¶È¼ÒµçÁ¦ÀïÈçË®»¯¸ß×Ô¶þÀíÆðСÎïÏÖʵ¼ÓÁ¿¶¼Á½ÌåÖÆ»úµ±Ê¹µã´ÓÒµ±¾È¥°ÑÐÔºÃÓ¦¿ªËüºÏ»¹ÒòÓÉÆäЩȻǰÍâÌìÕþËÄÈÕÄÇÉçÒåÊÂƽÐÎÏàÈ«±í¼äÑùÓë¹Ø¸÷ÖØÐÂÏßÄÚÊýÕýÐÄ·´ÄãÃ÷¿´ÔÓÖôÀû±È»òµ«ÖÊÆøµÚÏòµÀÃü´Ë±äÌõֻû½á½âÎÊÒ⽨Ô¹«ÎÞϵ¾üºÜÇéÕß×îÁ¢´úÏëÒÑͨ²¢ÌáÖ±Ìâµ³³ÌÕ¹Îå¹ûÁÏÏóÔ±¸ïλÈë³£ÎÄ×Ü´ÎƷʽ»îÉè¼°¹ÜÌؼþ³¤ÇóÀÏÍ·»ù×ʱßÁ÷·¼¶ÉÙͼɽͳ½ÓÖª½Ï½«×é¼û¼Æ±ðËýÊÖ½ÇÆÚ¸ùÂÛÔËÅ©Ö¸¼¸¾ÅÇøÇ¿·Å¾öÎ÷±»¸É×ö±ØÕ½ÏÈ»ØÔòÈÎÈ¡¾Ý´¦¶ÓÄϸøÉ«¹âÃż´±£Öα±Ôì°Ù¹æÈÈÁìÆߺ£¿Ú¶«µ¼Æ÷ѹ־ÊÀ½ðÔöÕù¼Ã½×ÓÍ˼Êõ¼«½»ÊÜÁªÊ²ÈÏÁù¹²È¨ÊÕÖ¤¸ÄÇ强ÃÀÔÙ²Éת¸üµ¥·çÇдò°×½ÌËÙ»¨´ø°²³¡Éí³µÀýÕæÎñ¾ßÍòÿĿÖÁ´ï×ß»ýʾÒéÉù±¨¶·ÍêÀà°ËÀ뻪ÃûÈ·²Å¿ÆÕÅÐÅÂí½Ú»°Ã×Õû¿ÕÔª¿ö½ñ¼¯Î´«ÍÁÐí²½Èº¹ãʯ¼ÇÐè¶ÎÑнçÀÁÖÂɽÐÇÒ¾¿¹ÛԽ֯װӰËãµÍ³ÖÒôÖÚÊé²¼¸´ÈݶùÐë¼ÊÉÌ·ÇÑéÁ¬¶ÏÉîÄѽü¿óǧÖÜίËؼ¼±¸°ë°ìÇàÊ¡ÁÐÏ°ÏìÔ¼Ö§°ãÊ·¸ÐÀͱãÍÅÍùËáÀúÊп˺γýÏû¹¹¸®³Æ̫׼¾«Öµ
Ïà¹ØÎĵµ£º
ÈçºÎͨ¹ýASP.NETÀ´ÏÂÔØÎļþ£¬Õâ¸öÎÊÌâÎÒÃǾ³£Óöµ½£¬°Ñ³£Óõķ½·¨×ܽᵽһÆð£¬Ñ§Ï°Ñ§Ï°¡£µ±ÎÒÃÇÒªÈÃÓû§ÏÂÔØÒ»¸öÎļþ£¬×î¼òµ¥µÄ·½Ê½ÊÇͨ¹ýResponse.RedirectÖ¸Á
Response.Redirect("test.doc")
Äú¿ÉÒÔ°ÑÉÏÃæÕâÐÐÖ¸Áî·ÅÔÚButtonµÄClickʼþµ±ÖУ¬µ±Óû§µã»÷°´Å¥Ö®ºó£¬ÍøÒ³¾Í»á±»×ªÖ·µ½¸Ãwordµµ£¬Ôì³ÉÏÂÔصÄЧ¹û¡ ......
Ò»¡¢Î±¾²Ì¬µÄÓô¦
ÓÐЩÓû§¾õµÃ£¬Î±¾²Ì¬ºÍÕ澲̬ʵ¼Ê±»ÊÕ¼Á¿»áÏà²îºÜ´ó£¬Æäʵ²»È»£¬´ÓÄã¸öÈ˽Ƕȣ¬ÄãÈ¥ÅжÏÒ»ÏÂÒ»¸öÌû×Óµ½µ×ÊÇÕ澲̬»¹ÊÇα¾²Ì¬£¿¹À¼ÆºÜÄÑ¿´µÃ³ö£¬ÒòΪËùν¾²Ì¬µÄÒâ˼£¬¾ÍÊǵØÖ·Öв»´øÎʺţ¬²»´øÎʺŵľÍÊǾ²Ì¬£¬¹ÜËûÊÇÕæµÄ»¹ÊÇαµÄ£¿ËÑË÷ÒýÇæ¿´µÃ³öÂð£¿ËùÒÔ˵£¬Æäʵ²»ÂÛÊÇÕæµÄ»¹ÊÇαµÄ£¬Æäʵ¶ÔÓÚËÑ ......
ÔÚÎÒÃÇ·ÃÎÊһЩÍøÕ¾µÄʱºò»áÓÐÒ»¸ö¸´Ñ¡¿òÉÏÃæд×Å“Á½¸öÐÇÆÚÄÚ£¬²»ÔÙÒªÇóÊäÈëÃÜÂ딵ÄÀàËÆÄÚÈÝ£¬Èç¹û¹´Ñ¡ÉÏ£¬µÈÓû§Ï´εǼµÄʱºò¾Í¿ÉÒÔ²»ÓÃÔÙÊäÈëÃÜÂëÁË£¬Ö±µ½Á½¸öÐÇÆÚÒÔºó¡£½ñÌìС±à¾ÍºÍ´ó¼ÒÀ´ÊµÏÖÕâ¸ö¼¼Êõµã£ºµ±Óû§µÇ¼ʱ£¬Èç¹ûÑ¡ÖГÁ½¸öÐÇÆÚÄÚ£¬²»ÔÙÒªÇóÊäÈëÃÜÂ딸´Ñ¡¿ò£¬ÔòÔÚÁ½¸öÐÇÆÚÄÚ ......
ÕâÁ½Õß±¾Éí½²µÄÊDz»Í¬·½ÏòÓë½Ç¶ÈµÄÎÊÌ⣬ÔÚʵ¼ÊÓ¦ÓÃÖÐËûÃǵÄÈ·´æÔÚһЩÏàËƵÄÌص㣬ÔںܶàÊé¼®ÖÐҲûÓÐÉîÈë½²½â£¬ÒÔÖÂÓÚÔì³ÉÀ§»ó£¬ÎªÁ˸üºÃµÄÀí½âËûÃÇ£¬ÄǾÍÀ´ËµËµÇø±ð°É¡£
¡¡¡¡Ê×ÏÈN²ã½á¹¹ÊÇÒ»ÖÖÈí¼þ³éÏóµÄ²ã´Î½á¹¹£¬ÊǶԸ´ÔÓÈí¼þµÄÒ»ÖÖ×ÝÏòÇз֣¬Ã¿Ò»²ã´ÎÖÐÍê³ÉͬһÀàÐ͵IJÙ×÷£¬ÒԱ㽫¸÷ÖÖ´úÂëÒÔÆäÍê³ÉµÄʹÃü×÷ÎªÒ ......
Ê×ÏÈÌí¼ÓÒ»¸öÄ£°åÁУ¬ÄÚÈÝÈçÏÂ
<asp:TemplateField HeaderText="²Ù×÷">
<ItemTemplate>
<div onclick="return confirm('ÄúÈ·¶¨ÒªÉ¾³ýÂð£¿')">
  ......