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

如何在ASP.NET页面中自动生成并显示透明的GIF图片

在页面中加入一个图片控件,并将它的Style属性设为:FILTER: chroma(color:#000000) ,原因是自动生成的GIF图片总是黑色背景。然后在后台代码中写入如下代码。(见DEMO)
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Drawing.Drawing2D;
namespace WebPageIndex
{
/**//// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.HtmlControls.HtmlImage IMG1;

private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
MyTempImage myTempImage=new MyTempImage();
IMG1.Src=myTempImage.CreateImage();

}
public class MyTempImage : Page
{
public string CreateImage()
{
string str="兴中公司财务章";
Bitmap image=new Bitmap(300,300);
Graphics g=Graphics.fromImage(image);
string thefullname=Server.MapPath("/")+"\\nowtime.gif";
Pen p=new Pen(Brushes.Red,10);
Pen p1=new Pen(Brushes.Red,5);
SolidBrush b=new SolidBrush(Color.Red);
g.SmoothingMode=SmoothingMode.AntiAlias;
Point point1 = new Point( 150, 50);
Point point2 = new Point(50, 150);
Point point3 = new Point(230, 150);

Point[] curvePoints =
{
point1,
point2,
point3,
};
g.FillPolygon(b,curvePoints,FillMode.Winding );
g.DrawEllipse(p,10,10,280,280);
g.DrawString(str,new Font("隶书",20,FontStyle.Bold),new
SolidBrush(Color.fromArgb(255, 255,0


相关文档:

Asp.NET log4net 的用法

用户可以从http://logging.apache.org/log4net/下载log4net的源代码。解压软件包后,在解压的src目录下将log4net.sln载入Visual Studio .NET,编译后可以得到log4net.dll。用户要在自己的程序里加入日志功能,只需将log4net.dll引入工程即可.
web.config 中的配置:
<section name="log4net" type="log4net.Config.Log ......

《ASP.NET MVC案例教程》

 本系列文章通过一个虚拟的案例——《MVC公告发布系统》的开发过程,全面展示了ASP.NET MVC的基本使用方法,同时在讨论了这个框架的基本原理。
      这个文章系列的目的就是使朋友们更轻松的入门ASP.NET MVC。
      这个系列会包含的内容有:ASP.NET ......

asp.net(c#)网页跳转七种方法小结

asp.net(c#)网页跳转七种方法小结
发布时间:2009-11-25 11:13:03
  1.Response.Redirect("http://www.yayiba.com",false);
  目标页面和原页面可以在2个服务器上,可输入网址或相对路径。后面的bool值为是否停止执行当前页。
跳转向新的页面,原窗口被代替。"
浏览器中的URL为新路径。
:Response.Redirect方 ......

在ASP.NET中,字符串的分割简单示例

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string str = "123456789";
        //string str1 = Eval("str").ToString ......

转:在ASP.NET中在不同页面间进行数据传递有哪些方法

搜的,网络很强大的
1. Get(即使用QueryString显式传递)
     方式:在url后面跟参数。
     特点:简单、方便。
     缺点:字符串长度最长为255个字符;数据泄漏在url中。
     适用数据:简单、少量、关键的数据。
   ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号