asp.net为图片添加文字水印
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
上传图片:<asp:FileUpload ID="uploadImage" runat="server" />
<br />
生成图片宽度:<asp:TextBox ID="TextBox1" runat="server">500</asp:TextBox>
<br />
生成图片高度:<asp:TextBox ID="TextBox2" runat="server">500</asp:TextBox>
<br />
每行显示字符数:<asp:TextBox ID="TextBox4" runat="server">20</asp:TextBox>
<br />
水印文字:<asp:TextBox ID="TextBox3" runat="server" TextMode="MultiLine">在人生的道路上,如果你没有耐心去等待成功的到来,那么你只好用一生的时间去等待失败!</asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="提交" />
<br />
</div>
</form>
</body>
</html>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
HttpPostedFile hpf = uploadImage.PostedFile;
//取得文件名,不含路径
char[] splitChar = { '\\' };
string[] FilenameArray = hpf.FileName.Split(
相关文档:
利用JQuery的$.ajax()可以很方便的调用asp.net的后台方法。
先来个简单的实例热热身吧。
1、无参数的方法调用
asp.net code:
using System.Web.Script.Services;
[WebMethod]
public static string SayHello()
{
return "Hello Ajax!";
}
注意:1.方法一定要静态方法,而且要有[WebMethod]的声明
JQuery ......
1.new有几种用法
第一种:new Class();
第二种:覆盖方法
public new XXXX(){}
第三种:new 约束指定泛型类声明中的任何类型参数都必须有公共的无参数构造函数。
2.如何把一个array复制到arrayList里
foreach( object o in array )arrayList.Add(o);
3.datagrid.datasous ......
asp.net在开发时,在不同的页面间跳转是我们常遇到的一件事,当一个复杂的逻辑在一个页面放不下分成二个或多个页面处理就需要在页面间跳转,用的最多还是用户的登陆吧.
ASP.NET用的最多的跳转是Response.Redirect,这个命令可以直接把请求重定向到一个相对或绝对的路径.它会把当前页面的的Http流阻断直接重定向到新的U ......
之前要完成一个支持多支持多种格式的视频播放器,在网上找到一个VB写的,然后改成C#,近段在网上也见有不少人问这个问,在此分享
public class VideoPlayer
{
/// <summary>
/// 生成视频播放器的HTM ......
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
namespace Maticsoft.DBUtility
{
/// <summary>
  ......