国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ??? ?? C#.Net ???? ASP.NET?? ?? ??? ???? ?? ??? ?? ??? ?? ????.

ASP.NET?? ?? ??? ???? ?? ??? ?? ??? ?? ????.

Jan 13, 2017 pm 02:27 PM

?? ??

/// <summary>
    /// 生成驗證碼圖片,保存session名稱VerificationCode
    /// </summary>
    public static void CreateVerificationCode()
    {
        int number;
        string checkCode = string.Empty;
        //隨機(jī)數(shù)種子
        Random randoms = new Random();
        for (int i = 0; i < 4; i++) //校驗碼長度為4
        {
            //隨機(jī)的整數(shù)
            number = randoms.Next();
            //字符從0-9,A-Z中隨機(jī)產(chǎn)生,對應(yīng)的ASCII碼分別為
            //48-57,65-90
            number = number % 36;
            if (number < 10)
            {
                number += 48;
            }
            else
            {
                number += 55;
            }
            checkCode += ((char)number).ToString();
        }
        //在session中保存校驗碼
        System.Web.HttpContext.Current.Session["VerificationCode"] = checkCode;
        //若校驗碼為空,則直接返回
        if (checkCode == null || checkCode.Trim() == String.Empty)
        {
            return;
        }
        //根據(jù)校驗碼的長度確定輸出圖片的長度
        System.Drawing.Bitmap image = new System.Drawing.Bitmap(55, 20);//(int)Math.Ceiling(Convert.ToDouble(checkCode.Length * 15))
        //創(chuàng)建Graphics對象
        Graphics g = Graphics.FromImage(image);
        try
        {
            //生成隨機(jī)數(shù)種子
            Random random = new Random();
            //清空圖片背景色
            g.Clear(Color.White);
            //畫圖片的背景噪音線 10條
            //---------------------------------------------------
            for (int i = 0; i < 10; i++)
            {
                //噪音線起點(diǎn)坐標(biāo)(x1,y1),終點(diǎn)坐標(biāo)(x2,y2)
                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.Silver), x1, y1, x2, y2);
            }
            //---------------------------------------------------
            //Brush b = Brushes.Silver;
            //g.FillRectangle(b, 0, 0, image.Width, image.Height);
            //---------------------以上兩種任選其一------------------------------
            //輸出圖片中校驗碼的字體: 12號Arial,粗斜體
            Font font = new Font("Arial", 12, (FontStyle.Bold | FontStyle.Italic));
            //線性漸變畫刷
            LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, image.Width, image.Height), Color.Blue, Color.Purple, 1.2f, true);
            g.DrawString(checkCode, font, brush, 2, 2);
            //畫圖片的前景噪音點(diǎn) 50個
            for (int i = 0; i < 50; 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(Color.Peru), 0, 0, image.Width - 1, image.Height - 1);
            //創(chuàng)建內(nèi)存流用于輸出圖片
            using (MemoryStream ms = new MemoryStream())
            {
                //圖片格式指定為png
                image.Save(ms, ImageFormat.Jpeg);
                //清除緩沖區(qū)流中的所有輸出
                System.Web.HttpContext.Current.Response.ClearContent();
                //輸出流的HTTP MIME類型設(shè)置為"image/Png"
                System.Web.HttpContext.Current.Response.ContentType = "image/Jpeg";
                //輸出圖片的二進(jìn)制流
                System.Web.HttpContext.Current.Response.BinaryWrite(ms.ToArray());
            }
        }
        finally
        {
            //釋放Bitmap對象和Graphics對象
            g.Dispose();
            image.Dispose();
        }
    }

aspx ??? ???

 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="AuthCode.aspx.cs" Inherits="AuthCode" %>

 <%Help.CreateVerificationCode(); %>

HTML ?? ? ?? ??

 <div class="positionR">
     <label>驗證碼:</label>
     <span class="style1"> *</span>
     <input type="text" class="yanZm" runat="Server" reg="^.+$" id="txtAuthCode" tip="請輸入驗證碼!" />
     <img class="yanZm_img lazy"  src="/static/imghw/default1.png"  data-src="AuthCode.aspx"    alt="" id="imgAuthCode" />
 </div>

?? ?? ?? ??

     <script type="text/javascript">
         $("#imgAuthCode").click(function () {
             $(this).attr("src", "AuthCode.aspx?code=" + (new Date()).getTime());
         });
     </script>

???

ASP.NET?? ?? ??? ???? ?? ??? ?? ??? ?? ????.

?? ?? ?? ? ?? ?? ?? ??? ?? ? ?? ASP.NET ?? ??? ??? PHP ??? ????? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

?? ????
1783
16
Cakephp ????
1728
56
??? ????
1577
28
PHP ????
1442
31
???
??? ????? C#? ?? ???? ???? ?????? ??? ????? C#? ?? ???? ???? ?????? Jun 19, 2025 am 12:17 AM

theieldKeyWordinc#simplifiesteratorcreationBeycreationSomateAtAtAtenablesLazyEvaluation.1.ItAllOwSreturningItemSoneatAtimeUsingyieldRetrern, weeneachitem, 2.yieldBreenceCanbeus

??? ?? (DI)?? ???? C# (? : ASP.NET Core?? ?? DI? ???? ??? ??? ? ?????)? ??? ??? ? ????? ??? ?? (DI)?? ???? C# (? : ASP.NET Core?? ?? DI? ???? ??? ??? ? ?????)? ??? ??? ? ????? Jun 30, 2025 am 02:06 AM

DependencyInjection(DI)inC#isadesignpatternthatenhancesmodularity,testability,andmaintainabilitybyallowingclassestoreceivedependenciesexternally.1.DIpromotesloosecouplingbydecouplingobjectcreationfromusage.2.Itsimplifiestestingthroughmockobjectinject

?? ????? idisposable ?????? C#? ?? ???? ??? ?????? ?? ????? idisposable ?????? C#? ?? ???? ??? ?????? Jun 27, 2025 am 02:18 AM

C#?? idisposable? ??? ??? ???? ?? ???? ????? ????? ???? ????. 1. idisposable? dispose () ???? ???? ???? ???? ?? ???? ???? ??? ???? ?? ? ? ???; 2. ?? ???? ??? ??? ??? ?? Dispose ()? ???? ????? ???? ??? ??? ????? ??? ?????. 3.?? ??? ? ??? idisposable? ???? ?? ??? ?? ? ? ??? StreamReader? ?? ??? ?? ???????. 4. ???? ?? ???? ??, ?? ? ??? ???? ???? Dispose (BOOL) ??? ???? ?? ???? ???? ?? ?? ?????.

Lambda Expressions and LINQ (Language Integrated Query)? C#? ??? ??? ??? ?? ????? Lambda Expressions and LINQ (Language Integrated Query)? C#? ??? ??? ??? ?? ????? Jun 20, 2025 am 12:16 AM

lambdaexpressionsandlinqsimplifydatamanipulationinc#byenablingconcise, ?? ?? ? ???? ??

C# 8? ?? ?? ?? (NRT)?? ???? NullReferenceException? ???? ? ??? ??????? C# 8? ?? ?? ?? (NRT)?? ???? NullReferenceException? ???? ? ??? ??????? Jun 21, 2025 am 12:36 AM

NULLABLEREFERENCETYPES (NRTS) INC#8 HELPCATCHNULLREFERNEEXCEPTIONERCECTIONPILETIMEBYMAKINGERENCETYPESNON-NULLABLEBYDEFAULT.NURTSMUSTBEEBEDITHERINTHETHETHE.CSPROJFILEWITHENORATTETTETOPA.CSFILESOUN NULL

C#? ??? ? ?? ??? ???? ???? ?? ?? ??? ?????? C#? ??? ? ?? ??? ???? ???? ?? ?? ??? ?????? Jun 23, 2025 am 12:05 AM

C# ???? 4 ?? ???? "??"??? ??????. ??, ???/???? ????? ??? ?? ?? ? ?? ??? ?????. ??? ?? ????? ??? ????, configureawait (false)? ???? ??? ????????. ??, VAR? ?? ??? ???? ???? ??? ??? ??? ??? ? ? ? ??? ?? ??? ???? ?????. ??, ?? ? ?? ??? ?? ???? ??? ???? ?? ???? ???? ?????? IDISPosable ?? ??? ?????????. ??, ?? ??? ?? ?? ?? ???? ?? ??? ???? ???? ??? ??, ? ?? ?? ????? ???? ????? ?? ??? ????????. ??? ??? ??? ?? ??? ?? ??? ?? ?? ? ? ????.

C#? SPAN ? ??? ? ???? ??? ???? ????? ??? ?? ??? ??? ?????? C#? SPAN ? ??? ? ???? ??? ???? ????? ??? ?? ??? ??? ?????? Jun 18, 2025 am 12:11 AM

?? ? ???? ??? ??? ????? C# ??? ??????. 1. ??? ?? ??? ??? ?? ???? ?? ??? ??? ????, ?? ?? ????, ??? ?? ? ??? ?? ??? ?????. 2. ???? ??? ??? ?? ??? ????? ???? ?? ????, ?? ? ??? ????? ??? ????? ?????. 3. ? ? GC ??? ??? ??? ????? ?? ??? ????? ??? ??????. 4. SPAN? ???? ???? ??? ???? ???? ????? ??? ???? ??? ? ????. Calling.toArray ()? ?? ? ?? ??? ??? ????????.

C# ?? ?? ????? ??? ??? ?? ????? ?? ? ? ????? C# ?? ?? ????? ??? ??? ?? ????? ?? ? ? ????? Jun 25, 2025 am 12:47 AM

??? ??? ?? ?? ?????? ?? ?? ?? ? ?? ?? ??????? 5 ?? ?? ?????. 1. SRP (Single Responsibility Principle)? ???? ??? ?? ?? ? ??? ??? ?? ??? ?? ? ????? ?????. 2. OCP (Opening and Closing Principle)? ISHAPE ?????? ???? ?? ???? ?? ??? ???? ?? ?? ?? ??? ???? ?? ????? ?? ?? ???? ?? ??? ????? ?? ?????. 3. Richter ?? ?? (LSP)? ?? ???? ??? ???? ?? ?? ???? ?? ? ? ??????. 4. ISP (Interface Displence Principle)? ?? ???? ??? ?? ?? ?? ? ?? ??? ?? ??? ?????? ??? ?????. 5. ??? ?? ?? (DIP)?

See all articles