/// 上传杂志封面 /// </summary> /// <param name="WebFile"></param> /// <param name="strFileName"></param> public void UploadCoverPic(System.Web.UI.HtmlControls.HtmlInputFile WebFile,string strFileName) { char[] spliter = {'\\'}; string [] FileName = strFileName.Split(spliter,10); string FullPath = UploadCoverPath + @"\" + @"\" + FileName[FileName.Length-1]; //生成完整文件名 WebFile.PostedFile.SaveAs(FullPath); //保存文件 } /// <summary> /// 上传下载杂志文件 /// </summary> /// <param name="WebFile"></param> /// <param name="strFileName"></param> public void UploadDownloadPic(System.Web.UI.HtmlControls.HtmlInputFile WebFile,string strFileName) { char[] spliter = {'\\'}; string [] FileName = strFileName.Split(spliter,10); string FullPath = UploadDownPath + @"\" + @"\" + FileName[FileName.Length-1]; //生成完整文件名 WebFile.PostedFile.SaveAs(FullPath); //保存文件 } /// <summary> /// 上传下载杂志文件 /// </summary> /// <param name="WebFile"></param> /// <param name="strFileName"></param> public void UploadBgMusicPic(System.Web.UI.HtmlControls.HtmlInputFile WebFile,string strFileName) { char[] spliter = {'\\'}; string [] FileName = strFileName.Split(spliter,10); string FullPath = UploadMusicPath + @"\" + @"\" + FileName[FileName.Length-1]; //生成完整文件名 WebFile.PostedFile.SaveAs(FullPath); //保存文件 }
public void UploadLeadShowPhotoFile(System.Web.UI.HtmlControls.HtmlInputFile WebFile,string strFileName) { char[] spliter = {'\\'}; string [] FileName = strFileName.Split(spliter,10); string FullPath = LeadShowPhoto + @"\" + FileName[FileName.Length-1]; //生成完整文件名 string fromFullPath = LeadShowPhoto + @"\" +"_new"+ FileName[FileName.Length-1]; //生成完整文件名 WebFile.PostedFile.SaveAs(fromFullPath); //保存文件
//加图片水印 System.Drawing.Image image=System.Drawing.Image.FromFile(fromFullPath); string fixinfo=image.PixelFormat.ToString(); if(fixinfo=="Format1bppIndexed"||fixinfo=="Format4bppIndexed"||fixinfo=="Format8bppIndexed"||fixinfo=="Undefined"||fixinfo=="DontCare"||fixinfo=="Format16bppArgb1555"||fixinfo=="Format16bppGrayScale") { WebFile.PostedFile.SaveAs(FullPath); } else { System.Drawing.Image copyImage=System.Drawing.Image.FromFile(LeadShowPhoto + @"\"+"DefaultLeadShow.gif"); Graphics g=Graphics.FromImage(image); g.DrawImage(copyImage,new Rectangle(image.Width-copyImage.Width,image.Height-copyImage.Height,copyImage.Width,copyImage.Height),0,0,copyImage.Width,copyImage.Height,GraphicsUnit.Pixel); g.Dispose();
//保存加水印过后的图片,删除原始图片 //string newPath=Server.MapPath(".")+"/img/"+fileName+"_new"+extension; image.Save(FullPath); image.Dispose(); if(File.Exists(fromFullPath)) { File.Delete(fromFullPath); } } }
}
} [办公软件]在Powerpoint中如何插入Flash动画 [办公软件]根除PowerPoint中Flash动画不能正常播放的问题 [办公软件]Office(Word,Excel)密码破解软件(Office Password… [办公软件]powerpoin自定义播放FLASH动画 [办公软件]PPT插入Flash其属性无自定义的两种解决办法 [办公软件]如何在excel中插入flash动画 [Sql Server]ASP.NET利用SQLDMO实现数据库的备份与恢复下篇 [Sql Server]ASP.NET利用SQLDMO实现数据库的备份与恢复上篇 [Web开发]ASP.NET地址重写、使用伪静态、页面回发处理 [Web开发]asp.net(c#)发送邮件代码
|