代码修改后的版本,全部提交

This commit is contained in:
ss001
2026-02-07 15:48:27 +08:00
parent cccbaa37c9
commit c2cda58c65
15604 changed files with 2455502 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
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._admin
{
public partial class Photo_upload2 : Mtxfw.Utility.AdminPage
{
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)
{
if (Request.Files["Photo"] != null)
{
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)
{
string FileName, FileType, Folders;
Folders = config.webUpPath;
FileName = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Millisecond.ToString();
FileType = Request.Files["Photo"].FileName.Substring(Request.Files["Photo"].FileName.LastIndexOf(".")).ToLower();
string strFilePath = Folders + FileName + FileType;
Request.Files["Photo"].SaveAs(Server.MapPath(strFilePath));
imgurl = FileName + FileType + "|" + Folders + FileName + FileType;
}
else
{
imgurl = "1";
}
}
else
{
imgurl = "0";
}
}
}
}
}
}