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

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

博客园 - 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/