您目前尚未登陆,请选择【登陆】或【注册
首页->电子商务->淘淘网电子商务网站源码(毕业设计)>>Admin/updown1.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:淘淘网电子商务网站源码(毕业设计)
当前文件:文件类型 TaoTaoBiz/Admin/updown1.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Collections; 3using System.ComponentModel; 4using System.Data; 5using System.Drawing; 6using System.Web; 7using System.Web.SessionState; 8using System.Web.UI; 9using System.Web.UI.WebControls; 10using System.Web.UI.HtmlControls; 11 12namespace web.Admin 13{ 14 /// <summary> 15 /// updown1 的摘要说明。 16 /// </summary> 17 public partial class updown1 : System.Web.UI.Page 18 { 19 20 protected string FileName = null; 21 protected string FileSaveUrl = null; 22 23 protected void Page_Load(object sender, System.EventArgs e) 24 { 25 // 在此处放置用户代码以初始化页面 26 } 27 28 Web 窗体设计器生成的代码 47 48 public string ImgUrl 49 { 50 get{ return FileSaveUrl; } 51 } 52 53 protected void Button1_Click(object sender, System.EventArgs e) 54 { 55 string fullFileName = upFile.PostedFile.FileName; 56 FileName = fullFileName.Substring( fullFileName.LastIndexOf("\\")+1 ); 57 string FileType = fullFileName.Substring( fullFileName.LastIndexOf(".")+1 ); 58 if( FileType == "bmp" || FileType == "jpg" || FileType == "gif" ) 59 { 60 FileSaveUrl = "../TopNews/UpDownImg/"+FileName; 61 upFile.PostedFile.SaveAs( Server.MapPath("../TopNews/UpDownImg"+"\\"+FileName) ); 62 Image1.ImageUrl = "../TopNews/UpDownImg/" + FileName; 63 TextBox1.Text = ImgUrl; 64 Response.Write("<script>alert('上传成功!')</script>"); 65 } 66 else 67 { 68 Response.Write("<script>alert('你上传的文件格式不对!')</script>"); 69 } 70 } 71 72 protected void Button3_Click(object sender, System.EventArgs e) 73 { 74 RegisterStartupScript("key","<script>window.returnValue=null;window.opener=null;window.close(this);</script>"); 75 } 76 77 protected void Button2_Click(object sender, System.EventArgs e) 78 { 79 if(TextBox1.Text==null||TextBox1.Text=="") 80 { 81 Response.Write("<script>alert('请上传图片!')</script>"); 82 } 83 else 84 { 85 RegisterStartupScript("key","<script>window.returnValue=document.subFrame.TextBox1.value;window.opener=null;window.close(this);</script>"); 86 } 87 } 88 } 89} 90
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:淘淘网电子商务网站源码(毕业设计)
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号