惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - Stym--闫生

最简单的silverlight的DataGrid行双击事件添加 == 在cmd命令下imp oracle dmp文件 flex TabNavigator 切换之前给出提示 - Stym--闫生 vb.net连接oracle和php连接oracle - Stym--闫生 - 博客园 数据库名,全局数据库名,SID 创建同义词和赋权限 linux下创建硬连接 flex 的as文件引用,包引用 - Stym--闫生 - 博客园 flex分页控件 - Stym--闫生 - 博客园 数据处理:等待条 把数组转化成一个xml字符串--php - Stym--闫生 - 博客园 php使用ajax技术 javascript拖住布局demo flex + Amfphp + mysql +IIS 5.1t 用sql查看表结构 C#使用sql语句读取excel文件数据 svn切换用户,报“501 Method Not Implemented”错误 div滤镜结合ajax,实现登录
c#生成验证图片
Stym--闫生 · 2008-09-23 · via 博客园 - Stym--闫生

目的,实现生成验证码的图片

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++)
    {
       
int y = rand.Next(image.Height);
        g.DrawLine(blackPen,
0,y,image.Width,y);
    }
   
    System.IO.MemoryStream ms
= new System.IO.MemoryStream();
    image.Save(ms,System.Drawing.Imaging.ImageFormat.Jpeg);
    Response.ClearContent();
    Response.ContentType
= "image/Jpeg";
    Response.BinaryWrite(ms.ToArray());
    g.Dispose();
    image.Dispose();
}

注释:本文摘抄自:为了明天,url:http://zt.cnblogs.com/page/42223/