由于asp.net-C中的保护级别错误而无法访问#
发布时间:2020-12-16 06:25:42 所属栏目:asp.Net 来源:网络整理
导读:我有两个班级’密码设置’和’帮助’.给出了课程. Passwordsettings.cs public class PasswordSetting{ public PasswordSetting() { } //password age,80,180,360 days public int Duration { get; set; } //password minimum length public int MinLength {
我有两个班级’密码设置’和’帮助’.给出了课程.
Passwordsettings.cs public class PasswordSetting { public PasswordSetting() { } //password age,80,180,360 days public int Duration { get; set; } //password minimum length public int MinLength { get; set; } //password maximum length public int MaxLength { get; set; } //password Numbers length public int NumsLength { get; set; } //password Upper letter length public int UpperLength { get; set; } //password Special character length public int SpecialLength { get; set; } //password valid special characters public string SpecialChars { get; set; } } Helper.cs public class Helper { public Helper() { //TODO: Add constructor logic here } public static PasswordSetting GetPasswordSetting() { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(HttpContext.Current.Server.MapPath("~/PasswordPolicy.xml")); PasswordSetting passwordSetting = new PasswordSetting(); foreach (XmlNode node in xmlDoc.ChildNodes) { foreach (XmlNode node2 in node.ChildNodes) { passwordSetting.Duration = int.Parse(node2["duration"].InnerText); passwordSetting.MinLength = int.Parse(node2["minLength"].InnerText); passwordSetting.MaxLength = int.Parse(node2["maxLength"].InnerText); passwordSetting.NumsLength = int.Parse(node2["numsLength"].InnerText); passwordSetting.SpecialLength = int.Parse(node2["specialLength"].InnerText); passwordSetting.UpperLength = int.Parse(node2["upperLength"].InnerText); passwordSetting.SpecialChars = node2["specialChars"].InnerText; } } return passwordSetting; } } 但是当我在按钮单击事件中使用它时,会出现以下问题..为什么会发生这种情况? 解决方法
由于某种原因,看起来Helper实际上是PasswordStreangth(原文如此)中的嵌套类.虽然Helper(已发布)是一个公共类,但我的猜测是PasswordStreangth是内部的.为什么Helper仍然是嵌套类?
当然,PasswordStreangth可能是你的命名空间 – 我手头没有VS来检查它是否会在Intellisense中显示出来.如果是这种情况,那么可能是Helper实际上并没有在您构建的版本中声明为公共 – 可能是代码中其他地方的更改,或者是陈旧的构建? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ASP.NET Server.Transfer()问题
- asp.net-mvc – 服务层或存储库中的密码哈希等?
- asp.net-mvc – 我必须做什么才能从MVC控制器重定向到Web窗
- asp.net-web-api – Webapi方法获取字符串参数未被调用
- asp.net-core – 如何在aspnet核心应用程序中为静态文件使用
- asp.net-mvc – MVC – 视图中的多个模型
- asp.net – Sub Page_Init方法:找不到事件init
- asp.net-core – 在IIS Express上运行MVC6 Beta8应用程序
- 什么是ASP.NET的最佳/推荐的CAPTCHA组件
- asp.net – Azure上的联合身份验证
推荐文章
站长推荐
热点阅读