易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net验证码

using System.Drawing;
using System.Drawing.Drawing2D;
类:
/// <summary>
/// 生成验证码
/// </summary>
private void DrowCode()
{
Response.Cache.SetNoStore();
System.Drawing.Bitmap image = new System.Drawing.Bitmap(77, 20);
Graphics g = Graphics.fromImage(image);
Color[] borders = new Color[10] { Color.AliceBlue, Color.Aqua, Color.Black, Color.Brown, Color.DarkRed, Color.SkyBlue, Color.Silver, Color.Tan, Color.Violet, Color.SpringGreen };
try
{
Random random = new Random();
g.Clear(Color.White);
//画图片的背景噪音线
for (int i = 0; i < 2; i++)
{
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);
}
string str = "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,V,W,X,Y,Z";
string[] codes = str.Split(',');
string serial = string.Empty;
for (int i = 0; i < 6; i++) // i 控制验证码字符个数
{
serial += codes[random.Next(codes.Length)];
}
Font font = new System.Drawing.Font("Verdana", 11, System.Drawing.FontStyle.Bold);
System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(0, 0, image.Width, image.Height), Color.Blue, Color.DarkRed, 1.2f, true);
g.DrawString(serial, font, brush, random.Next(image.Width - 77), random.Next(image.Height - 20));
//画图片的前景噪音点
for (int i = 0; i < 50; i++)
{
int x = random.Next(image.Width);
int y = random.Next(image.Height);
image.SetPixel(x, y,


相关文档:

如何打开别人的ASP.net项目

[转载]如何打开别人的ASP.net项目
如何打开别人的ASP.net项目2006-2-24 21:51:00
  (1)将项目文件夹拷贝到你机器的wwwroot目录
   (2)在IIS建立一个名称为WebApplication的虚拟目录,主目录设定为 C:\Inetpub\wwwroot            ......

配置ASP.net运行日志

我主要用来跟踪后台的一些情况,我用的是一个第三方插件,很好用的
log4net
具体使用如下:
Web.config配置:
<configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<log4net>
 &nbs ......

实现从弹出窗口中选择值 (asp.net C#)

在Asp.net中,从A页面中弹出B页面,在B页面中选择数据后,关闭并将数据更新到A页面,是一种常用的方式。只是我对Javascript不熟悉,所以捣鼓了一下午,终于有了一点成绩。
  测试项目有两个页面:Default.aspx及Default2.aspx,在Default.aspx页面上有一个TextBox1及一个Button1,Button1用于触发Default2.aspx,TextBox ......

asp.NET 如何生成DLL文件,并调用


使用csc命令将.cs文件编译成.dll的过程
很多时候,我们需要将.cs文件单独编译成.dll文件, 操作如下:
打开命令窗口->输入cmd到控制台->cd C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
转到vs.net安装的该目录下->执行csc命令csc /target:library File.cs->在该目录下产生一个对应名字的.dll文件(前提:把. ......

ASP.NET面试题 .NET系列面试题


2009-12-03
1. 简述 private、 protected、 public、 internal 修饰符的访问权限。
答 . private : 私有成员, 在类的内部才可以访问。
protected : 保护成员,该类内部和继承类中可以访问。
public : 公共成员,完全公开,没有访问限制。
internal: 在同一命名空间内可以访问。
2 .列举ASP.NET 页面之间传递值的 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号