using System; using System.Collections.Generic; using System.Data; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using Newtonsoft.Json; using System.IO; namespace Mtxfw.shop { public partial class Member_Photo_upload : Mtxfw.Utility.MemberBase { public string strQX = "", imgurl = "", imgurl2 = "", imgPath = ""; public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(); protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack) { bool IFUpload = false; if (Request.Files["Photo"] != null && Request.QueryString["yanse"] != null) { if (Session["jiaoyouPhoto"] != null) { string[] strjiaoyouPhotoA = Session["jiaoyouPhoto"].ToString().Split('|'); if (strjiaoyouPhotoA.Length > 100) { IFUpload = true; } } if (IFUpload) { imgurl = "2"; } else { string strContentType = Request.Files["Photo"].ContentType.ToLower(); int intContentLength = Request.Files["Photo"].ContentLength; if (strContentType.IndexOf("jpg") != -1 || strContentType.IndexOf("jpeg") != -1 || strContentType.IndexOf("gif") != -1 || strContentType.IndexOf("png") != -1 || strContentType.IndexOf("bmp") != -1) { if (intContentLength < 102400 * 20) { Mtxfw.Utility.UploadFile upload = new Mtxfw.Utility.UploadFile(Request.Files["Photo"], config.webUpPath, config.webUpType, int.Parse(config.webUpSize)); if (upload.StatrUpFile()) { if (Session["jiaoyouPhoto"] != null) { string strjiaoyouPhoto = Session["jiaoyouPhoto"].ToString(); strjiaoyouPhoto += upload.UploadPath + "|"; Session["jiaoyouPhoto"] = strjiaoyouPhoto; } else { string strjiaoyouPhoto = upload.UploadPath + "|"; Session["jiaoyouPhoto"] = strjiaoyouPhoto; } } string stryanseoption = ""; if (Request.QueryString["yanse"] != "") { string stryanse = Request.QueryString["yanse"].ToString().Replace(",","#"); string[] Ayanse = stryanse.Split('|'); for (int i = 0; i < Ayanse.Length; i++) { if (Ayanse[i] != "") { string[] stra = Ayanse[i].Split('#'); stryanseoption += ""; } } } if (Session["jiaoyouPhoto"] != null) { imgurl = ""; string[] strjiaoyouPhotoA = Session["jiaoyouPhoto"].ToString().Split('|'); for (int i = 0; i < strjiaoyouPhotoA.Length; i++) { if (strjiaoyouPhotoA[i] != "") { string[] strPhoto = strjiaoyouPhotoA[i].Split(','); imgurl += "
  • 删除"; if (i == 0) { imgurl += " 已设为封面"; } else { imgurl += " 设为封面"; } if (stryanseoption != "") { string stryanseoption2 = stryanseoption; if (strPhoto.Length == 2) { if (strPhoto[1] != "") { stryanseoption2 = stryanseoption.Replace("value='" + strPhoto[1] + "'", "value='" + strPhoto[1] + "' selected"); } } imgurl += "
    "; } imgurl += "
  • "; } } } } else { imgurl = "1"; } } else { imgurl = "0"; } } } } } } }