标签:tin center 控制器 提交 images 路径 indexof help action
///控制器
/// <summary>
/// 图片水印
/// </summary>
/// <param name="File1"></param>
/// <returns></returns>
public ActionResult shuiyinpost(HttpPostedFileBase File1)
{
string warning = "";
//获取图片的路径
string files = Server.MapPath(File1.FileName);
string filename = files.Remove(files.LastIndexOf("\\") - 5) + "images\\" + File1.FileName;
string watchname = files.Remove(files.LastIndexOf("\\") - 5) + "images\\" + "004 (2).jpg";
File1.SaveAs(filename);
//添加水印
string WarkUrl = WatherHelper.makewatermark(filename, watchname, WaterType.Center, files.Remove(files.LastIndexOf("\\") - 5) + "images\\", ImageType.JPEG, FileCache.Delete, out warning);
return Content(WarkUrl);
}
///视图
<form action="/Homes/shuiyinpost" enctype="multipart/form-data" method="post">
<input name="File1" type="file" /><input id="Button1" type="submit" value="提交" />
</form>
标签:tin center 控制器 提交 images 路径 indexof help action
原文地址:http://www.cnblogs.com/htbmvc/p/7880830.html