您目前尚未登陆,请选择【登陆】或【注册
首页->电子商务->淘淘网电子商务网站源码(毕业设计)>>Admin/updown.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:淘淘网电子商务网站源码(毕业设计)
当前文件:文件类型 TaoTaoBiz/Admin/updown.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 /// updown 的摘要说明。 16 /// </summary> 17 public partial class updown : 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// Button2.Attributes.Add("onclick", "return btnOpen_Click();"); 27 } 28 29 Web 窗体设计器生成的代码 48 49 public string ImgUrl 50 { 51 get{ return FileSaveUrl; } 52 } 53 54 protected void Button1_Click(object sender, System.EventArgs e) 55 { 56 string fullFileName = upFile.PostedFile.FileName; 57 FileName = fullFileName.Substring( fullFileName.LastIndexOf("\\")+1 ); 58 string FileType = fullFileName.Substring( fullFileName.LastIndexOf(".")+1 ); 59 if( FileType == "bmp" || FileType == "jpg" || FileType == "gif" ) 60 { 61 FileSaveUrl = "UpDownImg/"+FileName; 62 upFile.PostedFile.SaveAs( Server.MapPath("../TopNews/UpDownImg"+"\\"+FileName) ); 63 Image1.ImageUrl = "../TopNews/UpDownImg/" + FileName; 64 TextBox1.Text = ImgUrl; 65 Response.Write("<script>alert('上传成功!')</script>"); 66 } 67 else 68 { 69 Response.Write("<script>alert('你上传的文件格式不对!')</script>"); 70 } 71 } 72 73 protected void Button2_Click(object sender, System.EventArgs e) 74 { 75 if(TextBox1.Text==null||TextBox1.Text=="") 76 { 77 Response.Write("<script>alert('请上传图片!')</script>"); 78 } 79 else 80 { 81 RegisterStartupScript("key","<script>window.returnValue=document.subFrame.TextBox1.value;window.opener=null;window.close(this);</script>"); 82 } 83 } 84 85 protected void Button3_Click(object sender, System.EventArgs e) 86 { 87 RegisterStartupScript("key","<script>window.returnValue=null;window.opener=null;window.close(this);</script>"); 88 } 89 } 90} 91
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:淘淘网电子商务网站源码(毕业设计)
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号