private string GetCardKind(int validNum, int validUnit) { if (validUnit == 5) { return(UserGroups.GetUserGroupById(validNum).GroupName); } return(validNum.ToString() + Cards.GetValidUnitType(validUnit)); }
private void CheckeShop(UserInfo userInfo) { GroupType groupType = UserGroups.GetUserGroupById(userInfo.GroupId).GroupType; if (string.Compare(SiteConfig.SiteInfo.ProductEdition, "eShop", StringComparison.OrdinalIgnoreCase) == 0) { this.BtnOrderAdd.Visible = true; if (groupType == GroupType.Agent) { this.InfoTabTitle5.Visible = true; this.InfoTabTitle6.Visible = true; this.InfoTabTitle7.Visible = true; } } }
private void InitData() { this.HdnGroupId.Value = BasePage.RequestString("GroupID"); UserGroupsInfo userGroupById = UserGroups.GetUserGroupById(this.m_groupId); BasePage.SetSelectedIndexByValue(this.DropGropType, userGroupById.GroupType.ToString()); this.TxtGroupName.Text = userGroupById.GroupName; this.TxtDescription.Text = userGroupById.Description; this.HdnGroupName.Value = userGroupById.GroupName; if (BasePage.RequestInt32("GroupID") == -2) { this.DropGropType.Enabled = false; this.TxtGroupName.Enabled = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { EasyOne.Model.UserManage.UserInfo userInfo = this.UserInfo; if (userInfo == null) { userInfo = Users.GetUserById(DataConverter.CLng(base.Request.QueryString["UserID"])); this.ViewState["UserInfo"] = userInfo; } if (userInfo.IsNull) { BaseUserControl.WriteErrMsg("<li>找不到指定的会员!</li>"); } else { if (string.IsNullOrEmpty(userInfo.GroupName)) { userInfo.GroupName = UserGroups.GetUserGroupById(userInfo.GroupId).GroupName; } this.LblUserName.Text = userInfo.UserName; this.LblUserGroup.Text = userInfo.GroupName; if (!SiteConfig.SiteOption.EnablePointMoneyExp) { this.Balance.Style.Add("display", "none"); this.Point.Style.Add("display", "none"); this.UserExp.Style.Add("display", "none"); this.EndTime.Style.Add("display", "none"); } else { this.LblBalance.Text = userInfo.Balance.ToString("0.00"); this.LblPoint.Text = userInfo.UserPoint.ToString(); if (!userInfo.EndTime.HasValue) { this.LblEndTime.Text = ""; } else { this.LblEndTime.Text = userInfo.EndTime.Value.ToString("yyyy-MM-dd"); } this.LblUserExp.Text = userInfo.UserExp.ToString(); this.LblValidDays.Text = Users.GetValidNum(userInfo.EndTime); } } } }
protected void Page_Load(object sender, EventArgs e) { this.groupId = BasePage.RequestInt32("GroupID"); this.HdnGroupId.Value = BasePage.RequestString("GroupID"); if (!this.Page.IsPostBack) { UserGroupsInfo userGroupById = UserGroups.GetUserGroupById(this.groupId); this.LblGroupName.Text = userGroupById.GroupName; this.LblDescription.Text = userGroupById.Description; this.HdnGroupName.Value = userGroupById.GroupName; this.LblGropType.Text = BasePage.EnumToHtml <GroupType>(userGroupById.GroupType); if (!string.IsNullOrEmpty(userGroupById.GroupSetting)) { this.UserIndividuation.PurviewInfo = UserGroups.GetGroupSetting(userGroupById.GroupSetting); } } }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName); if (usersByUserName.IsNull) { DynamicPage.WriteErrMsg("<li>没有" + PEContext.Current.User.UserName + "的用户信息,请检查此用户是否注册是否存在!</li>"); } if (usersByUserName.UserType == UserType.Creator) { this.m_ShowCompanyInfo = true; this.Company1.Action = "modify"; this.Company1.CompanyId = usersByUserName.CompanyId; this.Company1.Visible = true; } this.LblUserName.Text = usersByUserName.UserName; this.LblUserGroup.Text = UserGroups.GetUserGroupById(usersByUserName.GroupId).GroupName; this.LblUserType.Text = BasePage.EnumToHtml <UserType>(usersByUserName.UserType); this.TxtQuestion.Text = usersByUserName.Question.ToString(); this.TxtEmail.Text = usersByUserName.Email.ToString(); this.RadlPrivacySetting.Text = usersByUserName.PrivacySetting.ToString(); this.TxtUserFace.Text = usersByUserName.UserFace.ToString(); this.TxtFaceWidth.Text = usersByUserName.FaceWidth.ToString(); this.TxtSign.Text = usersByUserName.Sign.ToString(); this.TxtFaceHeight.Text = usersByUserName.FaceHeight.ToString(); this.TxtTrueName.Text = usersByUserName.UserTrueName; ContacterInfo contacterInfo = new ContacterInfo(); contacterInfo = Contacter.GetContacterByUserName(usersByUserName.UserName); this.PersonalInformation1.SetContacter(contacterInfo); this.LiaisonInformation1.SetContacter(contacterInfo); this.TxtTrueName.Text = contacterInfo.TrueName; this.TxtTitle.Text = contacterInfo.Title; this.HdnContacterID.Value = contacterInfo.ContacterId.ToString(); this.TxtCompany.Text = contacterInfo.Company; this.TxtDepartment.Text = contacterInfo.Department; this.TxtPosition.Text = contacterInfo.Position; this.TxtOperation.Text = contacterInfo.Operation; this.TxtCompanyAddress.Text = contacterInfo.CompanyAddress; } }
protected void ButtonSubmit_Click(object sender, EventArgs e) { UserGroupsInfo userGroupById = UserGroups.GetUserGroupById(DataConverter.CLng(this.HdnGroupId.Value)); userGroupById.GroupSetting = new Serialize <UserPurviewInfo>().SerializeField(this.UserIndividuation.PurviewInfo); switch (UserGroups.Update(userGroupById)) { case DataActionState.Successed: AdminPage.WriteSuccessMsg("<li>设置" + userGroupById.GroupName + "会员组权限成功!</li>", "UserGroupManage.aspx"); return; case DataActionState.Exist: break; case DataActionState.Unknown: AdminPage.WriteErrMsg("<li>设置" + userGroupById.GroupName + "会员组权限失败!</li>", "UserGroupManage.aspx"); break; default: return; } }
protected void ButtonSubmit_Click(object sender, EventArgs e) { UserGroupsInfo userGroupById; GroupType type = (GroupType)Enum.Parse(typeof(GroupType), this.DropGropType.SelectedValue); if (this.HdnAction.Value == "Modify") { userGroupById = UserGroups.GetUserGroupById(DataConverter.CLng(this.HdnGroupId.Value)); } else { userGroupById = new UserGroupsInfo(); } userGroupById.GroupName = this.TxtGroupName.Text; userGroupById.Description = this.TxtDescription.Text; userGroupById.GroupType = type; DataActionState unknown = DataActionState.Unknown; if (this.Page.IsValid) { if (this.HdnAction.Value == "Modify") { unknown = DataActionState.Exist; if ((userGroupById.GroupName != this.HdnGroupName.Value) && UserGroups.GroupNameIsExist(userGroupById.GroupName)) { this.ShowMessage(unknown); } unknown = UserGroups.Update(userGroupById); } else { unknown = UserGroups.Add(userGroupById); this.m_groupId = userGroupById.GroupId; } this.ShowMessage(unknown); } }
protected void BtnSave_Click(object sender, EventArgs e) { double totalDays; int validNum; IEncourageStrategy <int> strategy2; if (!base.IsValid) { return; } string password = StringHelper.Base64StringEncode(this.TxtPassword.Text); CardInfo cardByNumAndPassword = Cards.GetCardByNumAndPassword(this.TxtCardNum.Text.Trim(), password); if (cardByNumAndPassword.IsNull) { DynamicPage.WriteErrMsg("卡号或密码错误!"); } else { if (cardByNumAndPassword.CardType != 0) { DynamicPage.WriteErrMsg("你输入的充值卡是其他公司的卡,不能在本站进行充值。请尽快去有关公司或网站的充值入口进行充值。"); } if (!string.IsNullOrEmpty(cardByNumAndPassword.UserName)) { DynamicPage.WriteErrMsg("你输入的充值卡已经使用过了!"); } if (cardByNumAndPassword.EndDate < DateTime.Today) { DynamicPage.WriteErrMsg("你输入的充值卡已经失效!此卡的充值截止日期为:" + cardByNumAndPassword.EndDate.ToString("yyyy-MM-dd")); } } UserInfo userInfo = this.showUserInfo.UserInfo; bool flag = false; string groupName = string.Empty; StringBuilder builder = new StringBuilder(); builder.Append("<li>充值成功!</li>"); if (cardByNumAndPassword.ValidUnit == 5) { groupName = UserGroups.GetUserGroupById(cardByNumAndPassword.ValidNum).GroupName; builder.Append("<li><span style='Color:#F00'>恭喜您已升级成\"" + groupName + "\"</span></li>"); } builder.Append("<li>充值卡卡号:" + cardByNumAndPassword.CardNum + "</li>"); builder.Append("<li>充值卡面值:" + cardByNumAndPassword.Money.ToString("N2") + "元</li>"); builder.Append("<li>充值截止日期:" + cardByNumAndPassword.EndDate.ToString("yyyy-MM-dd") + "</li>"); switch (cardByNumAndPassword.ValidUnit) { case 0: { builder.Append("<li>充值卡点数:" + cardByNumAndPassword.ValidNum.ToString() + Cards.GetValidUnitType(cardByNumAndPassword.ValidUnit) + "</li>"); builder.Append("<li>您充值前的" + SiteConfig.UserConfig.PointName + "数:" + userInfo.UserPoint.ToString() + "</li>"); IEncourageStrategy <int> strategy = new UserPoint(); flag = strategy.IncreaseForUsers(userInfo.UserId.ToString(), cardByNumAndPassword.ValidNum, "充值卡充值。卡号:" + cardByNumAndPassword.CardNum, true, ""); string[] strArray2 = new string[] { "<li>您充值后的", SiteConfig.UserConfig.PointName, "数:", (userInfo.UserPoint + cardByNumAndPassword.ValidNum).ToString(), "</li>" }; builder.Append(string.Concat(strArray2)); goto Label_059A; } case 1: case 2: case 3: { builder.Append("<li>充值卡内含有效期:" + cardByNumAndPassword.ValidNum.ToString() + Cards.GetValidUnitType(cardByNumAndPassword.ValidUnit) + "</li>"); TimeSpan span = (TimeSpan)(DataConverter.CDate(userInfo.EndTime).Date - DateTime.Today.Date); totalDays = span.TotalDays; validNum = cardByNumAndPassword.ValidNum; strategy2 = new UserDate(); switch (cardByNumAndPassword.ValidUnit) { case 2: validNum *= 30; break; case 3: validNum *= 0x16d; break; } break; } case 4: { builder.Append("<li>充值卡内含资金:" + cardByNumAndPassword.ValidNum.ToString() + Cards.GetValidUnitType(cardByNumAndPassword.ValidUnit) + "</li>"); builder.Append("<li>您充值前的资金余额为:" + userInfo.Balance.ToString("N2") + "元</li>"); IEncourageStrategy <decimal> strategy3 = new UserMoney(); flag = strategy3.IncreaseForUsers(userInfo.UserId.ToString(), cardByNumAndPassword.ValidNum, "充值卡充值。卡号:" + cardByNumAndPassword.CardNum, true, ""); builder.Append("<li>您充值后的资金余额为:" + ((userInfo.Balance + cardByNumAndPassword.ValidNum)).ToString("N2") + "元</li>"); goto Label_059A; } case 5: builder.Append("<li>会员级别:" + groupName + "</li>"); flag = Users.MoveByUserName(userInfo.UserName, cardByNumAndPassword.ValidNum); goto Label_059A; default: goto Label_059A; } if (totalDays > 0.0) { builder.Append("<li>您充值前的有效期:" + totalDays.ToString() + "天</li>"); flag = strategy2.IncreaseForUsers(userInfo.UserId.ToString(), validNum, "充值卡充值。卡号:" + cardByNumAndPassword.CardNum, true, ""); builder.Append("<li>您充值后的有效期:" + ((totalDays + validNum)).ToString() + "天</li>"); } else { builder.Append("<li>您充值前有效期已经过期" + Math.Abs(totalDays).ToString() + "天</li>"); flag = strategy2.IncreaseForUsers(userInfo.UserId.ToString(), validNum, "充值卡充值。卡号:" + cardByNumAndPassword.CardNum, true, ""); builder.Append("<li>您充值后的有效期:" + validNum.ToString() + "天,开始计算日期:" + DateTime.Today.ToString("yyyy-MM-dd") + "</li>"); } Label_059A: if (flag) { cardByNumAndPassword.UserName = userInfo.UserName; cardByNumAndPassword.UseTime = new DateTime?(DateTime.Now); Cards.Update(cardByNumAndPassword); DynamicPage.WriteSuccessMsg(builder.ToString(), "Recharge.aspx"); } else { DynamicPage.WriteErrMsg("充值失败!"); } }
protected void BtnUpload_Click(object sender, EventArgs e) { int uploadSize = 0; if (!SiteConfig.SiteOption.EnableUploadFiles) { this.LblMessage.Text = "权限错误:你当前的网站没有开启上传功能,请检查你的网站配置。"; } else { if (!PEContext.Current.Admin.Identity.IsAuthenticated) { if (!PEContext.Current.User.Identity.IsAuthenticated) { UserGroupsInfo userGroupById = UserGroups.GetUserGroupById(-2); if (string.IsNullOrEmpty(userGroupById.GroupSetting)) { this.LblMessage.Text = "匿名会员组不存在!"; return; } UserPurviewInfo groupSetting = UserGroups.GetGroupSetting(userGroupById.GroupSetting); if (groupSetting.IsNull) { this.LblMessage.Text = "匿名会员组没有进行权限设置!"; return; } if (!groupSetting.EnableUpload) { this.LblMessage.Text = "匿名会员组没有开启上传权限!"; return; } uploadSize = groupSetting.UploadSize; } else { if (!PEContext.Current.User.UserInfo.UserPurview.EnableUpload) { this.LblMessage.Text = "所属会员组没有开启上传权限!"; return; } uploadSize = PEContext.Current.User.UserInfo.UserPurview.UploadSize; } } string str = BasePage.RequestString("ReturnJSFunction"); int num2 = DataConverter.CLng(base.Request.Form["ThumbIndex"]); if (string.IsNullOrEmpty(str)) { str = "DealwithUpload"; } StringBuilder builder = new StringBuilder(); builder.Append("<script language=\"javascript\" type=\"text/javascript\">"); if (!PEContext.Current.Admin.Identity.IsAuthenticated && (this.m_PhotoSize > uploadSize)) { this.m_PhotoSize = uploadSize; } int num3 = 0; StringBuilder builder2 = new StringBuilder(); for (int i = 0; i < 10; i++) { num3++; System.Web.UI.WebControls.FileUpload upload = (System.Web.UI.WebControls.FileUpload) this.FindControl("FileUpload" + i.ToString()); if (upload.HasFile) { string str2 = Path.GetExtension(upload.FileName).ToLower(); if (!this.CheckFilePostfix(str2.Replace(".", ""))) { builder2.Append("文件" + upload.FileName + "上传文件类型不对!必须上传" + this.m_FileExtArr + @"的后缀名!\n"); } else if (((int)upload.FileContent.Length) > (this.m_PhotoSize * 0x400)) { builder2.Append("文件" + upload.FileName + "请上传小于" + this.m_PhotoSize.ToString() + @"KB的文件!\n"); } else { string str3 = DataSecurity.MakeFileRndName() + i.ToString(); string filename = FileSystemObject.CreateFileFolder((VirtualPathUtility.AppendTrailingSlash(SiteConfig.SiteOption.UploadDir) + this.FileSavePath(upload.FileName)).Replace("//", "/"), HttpContext.Current) + str3 + str2; upload.SaveAs(filename); Thumbs.GetThumbsPath(this.m_ShowPath + str3 + str2, this.m_ShowPath + str3 + "_S" + str2); if (this.m_Watermark) { WaterMark.AddWaterMark(this.m_ShowPath + str3 + str2); } EasyOne.Model.Accessories.FileInfo fileInfo = new EasyOne.Model.Accessories.FileInfo(); fileInfo.Name = upload.FileName; fileInfo.Path = this.m_ShowPath + str3 + str2; fileInfo.Size = (int)upload.FileContent.Length; fileInfo.Quote = 1; Files.Add(fileInfo); if (i == num2) { builder.Append("parent." + str + "ChangeThumbField(\"" + fileInfo.Path + "\",\"" + this.m_ShowPath + str3 + "_S" + str2 + "\");"); } else { builder.Append("parent." + str + "DealwithUpload(\"" + fileInfo.Path + "\",\"" + fileInfo.Size.ToString() + "\",\"" + fileInfo.Id.ToString() + "\",\"" + this.m_ShowPath + str3 + "_S" + str2 + "\");"); } builder2.Append("文件" + upload.FileName + @"上传成功!\n"); } } } if (builder2.Length > 0) { builder.Append("parent." + str + "ErrMessage(\"" + builder2.ToString() + "\");"); } builder.Append("</script>"); this.Page.ClientScript.RegisterStartupScript(base.GetType(), "UpdateParent", builder.ToString()); } }
protected void BtnUpload_Click(object sender, EventArgs e) { if (!this.FupFile.HasFile) { this.ReturnManage("上传失败,重新上传。"); return; } int uploadFileMaxSize = 0; int uploadSize = 0; bool flag = false; bool flag2 = false; if (!SiteConfig.SiteOption.EnableUploadFiles) { this.ReturnManage("权限错误:对不起网站没有开启上传权限。"); return; } if (!PEContext.Current.Admin.Identity.IsAuthenticated) { if (!PEContext.Current.User.Identity.IsAuthenticated) { UserGroupsInfo userGroupById = UserGroups.GetUserGroupById(-2); if (string.IsNullOrEmpty(userGroupById.GroupSetting)) { this.ReturnManage("匿名会员组不存在!"); return; } UserPurviewInfo groupSetting = UserGroups.GetGroupSetting(userGroupById.GroupSetting); if (groupSetting.IsNull) { this.ReturnManage("匿名会员组没有进行权限设置!"); return; } if (!groupSetting.EnableUpload) { this.ReturnManage("匿名会员组没有开启上传权限!"); return; } uploadSize = groupSetting.UploadSize; } else { if (!PEContext.Current.User.UserInfo.UserPurview.EnableUpload) { this.ReturnManage("所属会员组没有开启上传权限!"); return; } uploadSize = PEContext.Current.User.UserInfo.UserPurview.UploadSize; } } string str = Path.GetExtension(this.FupFile.FileName).ToLower(); if (!this.CheckFilePostfix(str.Replace(".", ""))) { this.ReturnManage("上传文件类型不对!必须上传" + this.m_FileExtArr + "的后缀名!"); return; } if (string.Compare(this.m_ModuleName, "Node", StringComparison.OrdinalIgnoreCase) == 0) { FieldInfo fieldInfoByFieldName = Field.GetFieldInfoByFieldName(this.m_ModelId, this.m_FieldName); Collection <string> settings = fieldInfoByFieldName.Settings; switch (fieldInfoByFieldName.FieldType) { case FieldType.PictureType: uploadFileMaxSize = DataConverter.CLng(settings[1]); flag2 = DataConverter.CBoolean(settings[4]); flag = DataConverter.CBoolean(settings[5]); goto Label_01EA; case FieldType.FileType: uploadFileMaxSize = DataConverter.CLng(settings[0]); goto Label_01EA; } } else { uploadFileMaxSize = SiteConfig.SiteOption.UploadFileMaxSize; } Label_01EA: if (!PEContext.Current.Admin.Identity.IsAuthenticated && (uploadFileMaxSize > uploadSize)) { uploadFileMaxSize = uploadSize; } if (((int)this.FupFile.FileContent.Length) > (uploadFileMaxSize * 0x400)) { this.ReturnManage("请上传小于" + uploadFileMaxSize.ToString() + "KB的文件!"); } else { string str2 = DataSecurity.MakeFileRndName(); string filename = FileSystemObject.CreateFileFolder((VirtualPathUtility.AppendTrailingSlash(SiteConfig.SiteOption.UploadDir) + this.FileSavePath()).Replace("//", "/"), HttpContext.Current) + str2 + str; this.FupFile.SaveAs(filename); string thumbnailPath = ""; if (flag) { thumbnailPath = this.m_ShowPath + str2 + "_S" + str; Thumbs.GetThumbsPath(this.m_ShowPath + str2 + str, thumbnailPath); } else { thumbnailPath = this.m_ShowPath + str2 + str; } if (flag2) { WaterMark.AddWaterMark(this.m_ShowPath + str2 + str); } EasyOne.Model.Accessories.FileInfo fileInfo = new EasyOne.Model.Accessories.FileInfo(); fileInfo.Name = this.FupFile.FileName; fileInfo.Path = thumbnailPath; fileInfo.Size = (int)this.FupFile.FileContent.Length; fileInfo.Quote = 1; if (string.Compare(this.m_ModuleName, "soft", StringComparison.OrdinalIgnoreCase) == 0) { Files.Add(fileInfo); } this.GetScriptByModuleName(fileInfo); this.ReturnManage("上传成功!"); } }
protected override void OnLoad(EventArgs e) { HttpPostedFile file = base.Request.Files["NewFile"]; string str = Path.GetExtension(file.FileName).ToLower(); string uploaderType = base.Request.Form["UploaderType"]; bool flag = DataConverter.CBoolean(base.Request.Form["IsWatermark"]); bool flag2 = DataConverter.CBoolean(base.Request.Form["IsThumb"]); int modelId = DataConverter.CLng(base.Request.Form["ModelId"]); string str3 = DataSecurity.FilterBadChar(base.Request.Form["FieldName"]); string allowSuffix = ""; int uploadFileMaxSize = 0; int uploadSize = 0; string customMsg = "请检查网站信息配置是否设置允许的上传文件大小!"; if (!SiteConfig.SiteOption.EnableUploadFiles) { this.SendResults(0xcc); } else { if (!PEContext.Current.Admin.Identity.IsAuthenticated) { if (!PEContext.Current.User.Identity.IsAuthenticated) { UserGroupsInfo userGroupById = UserGroups.GetUserGroupById(-2); if (string.IsNullOrEmpty(userGroupById.GroupSetting)) { this.SendResults(1, "", "", "匿名会员组不存在!"); return; } UserPurviewInfo groupSetting = UserGroups.GetGroupSetting(userGroupById.GroupSetting); if (groupSetting.IsNull) { this.SendResults(1, "", "", "匿名会员组没有进行权限设置!"); return; } if (!groupSetting.EnableUpload) { this.SendResults(1, "", "", "匿名会员组没有开启上传权限!"); return; } uploadSize = groupSetting.UploadSize; } else { if (!PEContext.Current.User.UserInfo.UserPurview.EnableUpload) { this.SendResults(1, "", "", "所属会员组没有开启上传权限!"); return; } uploadSize = PEContext.Current.User.UserInfo.UserPurview.UploadSize; } } if ((file == null) || (file.ContentLength == 0)) { this.SendResults(0xca); } else { if ((modelId == 0) || string.IsNullOrEmpty(str3)) { if (!ConfigurationManager.AppSettings["EasyOne:DefaultUploadSuffix"].ToLower().Contains(str)) { this.SendResults(1, "", "", "不允许上传动态页文件!"); return; } uploadFileMaxSize = SiteConfig.SiteOption.UploadFileMaxSize; } else { IList <FieldInfo> fieldListByModelId = ModelManager.GetFieldListByModelId(modelId); if ((fieldListByModelId != null) && (fieldListByModelId.Count > 0)) { foreach (FieldInfo info3 in fieldListByModelId) { if (string.CompareOrdinal(info3.FieldName, str3) == 0) { allowSuffix = GetAllowSuffix(info3, uploaderType); if (info3.Settings.Count > 7) { uploadFileMaxSize = DataConverter.CLng(info3.Settings[7]); } break; } } } if (string.IsNullOrEmpty(allowSuffix)) { this.SendResults(1, "", "", "字段内容控件没有填写允许上传的后缀!"); return; } if (!allowSuffix.Contains(str.Replace(".", ""))) { this.SendResults(1, "", "", "这种文件类型不允许上传!只允许上传这几种文件类型:" + allowSuffix); return; } customMsg = "请检查所属字段控件是否设置了允许上传文件大小!"; } if (uploadFileMaxSize <= 0) { this.SendResults(1, "", "", customMsg); } else { if (!PEContext.Current.Admin.Identity.IsAuthenticated && (uploadFileMaxSize > uploadSize)) { uploadFileMaxSize = uploadSize; } if (file.ContentLength > (uploadFileMaxSize * 0x400)) { this.SendResults(1, "", "", "请上传小于" + uploadFileMaxSize.ToString() + "KB的文件!"); } else { string str9; int errorNumber = 0; string fileUrl = ""; string str7 = DataSecurity.MakeFileRndName(); string str8 = str7 + str; int num5 = 0; while (true) { str9 = Path.Combine(base.UserFilesDirectory, str8); if (!File.Exists(str9)) { break; } num5++; str8 = string.Concat(new object[] { Path.GetFileNameWithoutExtension(file.FileName), "(", num5, ")", Path.GetExtension(file.FileName) }); errorNumber = 0xc9; } file.SaveAs(str9); fileUrl = base.UserFilesPath + str8; if (!string.IsNullOrEmpty(uploaderType) && (string.CompareOrdinal(uploaderType, "Photo") == 0)) { string oldValue = ""; if (base.Request.ApplicationPath.EndsWith("/", StringComparison.Ordinal)) { oldValue = ("/" + SiteConfig.SiteOption.UploadDir + "/").Replace("//", "/"); } else { oldValue = base.Request.ApplicationPath + "/" + SiteConfig.SiteOption.UploadDir; } if (flag2) { string str11 = base.UserFilesPath + str7 + "_S" + str; Thumbs.GetThumbsPath(fileUrl.Replace(oldValue, ""), str11.Replace(oldValue, "")); } if (flag) { WaterMark.AddWaterMark(fileUrl.Replace(oldValue, "")); } } this.SendResults(errorNumber, fileUrl, str8); } } } } }