<input type="hidden" id="y1" />
<input type="hidden" id="w" />
<input type="hidden" id="h" />
<input id="SaveImgSrcValue" type="hidden" name="SaveImgSrcValue" />
<img id="Img1" /><input id="Button1" type="button" value="生成头像" onclick="show();" />
</form>
</body>
</html>
ashx代码
<%@ WebHandler Language="C#" Class="UpLoadImg" %>
using System;
using System.Web;
using System.IO;
using System.Drawing;
public class UpLoadImg : IHttpHandler {
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Expires = -1;
try
{
HttpPostedFile postedFile = context.Request.Files["Filedata"];
string savepath = "";