Web.UI/UpLoad.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Web;
using System.IO;
using System.Drawing;
using System.Net;
using System.Configuration;
using Common;
namespace Web.UI
{
public class UpLoad
{
private Model.WebSet webset;
private string filePath; //上传目录名
private readonly string fileType; //文件类型
private readonly int fileSize; //文件大小0为不限制
private readonly int isWatermark; //0为不加水印,1为文字水印,2为图片水印
private readonly int waterStatus; //水印位置
private readonly int waterQuality; //水印图片质量
private readonly string imgWaterPath; //水印图片地址
private readonly int waterTransparency; //水印图片透时度
private readonly string textWater; //水印文字
private readonly string textWaterFont; //文字水印字体
private readonly int textFontSize; //文字大小
public UpLoad()
{
webset = new BLL.WebSet().loadConfig(Utils.GetXmlMapPath("Configpath"));
filePath = webset.WebPath + webset.WebFilePath;
fileType = webset.WebFileType;
fileSize = webset.WebFileSize;
isWatermark = webset.IsWatermark;
waterStatus = webset.WatermarkStatus;
waterQuality = webset.ImgQuality;
imgWaterPath = webset.WebPath + webset.ImgWaterPath;
waterTransparency = webset.ImgWaterTransparency;
textWater = webset.WaterText;
textWaterFont = webset.WaterFont;
textFontSize = webset.FontSize;
}
///<summary>
/// 文件上传方法
/// </summary>
public string fileSaveAs(HttpPostedFile _postedFile, int _isWater)
{
try
{
string _fileExt = _postedFile.FileName.Substring(_postedFile.FileName.LastIndexOf(".") + 1);
//验证合法的文件
if (!CheckFileExt(this.fileType, _fileExt))
{
return "{msg: 0, msbox: \"不允许上传" + _fileExt + "类型的文件!\"}";
}
if (this.fileSize > 0 && _postedFile.ContentLength > fileSize * 1024)
{
return "{msg: 0, msbox: \"文件超过限制的大小啦!\"}";
}
string _fileName = DateTime.Now.ToString("yyyyMMddHHmmssff") + "." + _fileExt; //随机文件名
//检查保存的路径 是否有/开头结尾
后面还有 56 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。