编译器错误消息: CS0122: “DAL.FormatString”不可访问,因为它受保护级别限制
时间:2011-12-16
来源:互联网
编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。
编译器错误消息: CS0122: “DAL.FormatString”不可访问,因为它受保护级别限制
源错误:
行 20: BLL.NewsLogic B_news = new BLL.NewsLogic();
行 21: BLL.BigClassLogic B_bc = new BLL.BigClassLogic();
行 22: DAL.FormatString FString = new DAL.FormatString();
行 23:
行 24: protected void Page_Load(object sender, EventArgs e)
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DAL;
public partial class web_Default2 : System.Web.UI.Page
{
/// <summary>
/// 实例化接口层NewsLogic类的对象
/// </summary>
BLL.NewsLogic B_news = new BLL.NewsLogic();
BLL.BigClassLogic B_bc = new BLL.BigClassLogic();
DAL.FormatString FString = new DAL.FormatString();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DataBindRepeater1();
DataBindRepeaterBigClass();
this.Title = "新闻系统----本系统采用ASP.NET 3.5+SQL Server 2005技术架构!";
Session.Clear();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DAL
{
/// <summary>
/// 字符串处理类
/// </summary>
public class FormatString
{
#region 字符串截取函数
/// <summary>
/// 截取字符串方法
/// </summary>
/// <param name="inputString">要截取的原字符串</param>
/// <param name="len">要截取的长度</param>
/// <returns>截取后的字符串</returns>
public string CutString(string str1, int length)
{
int s = str1.Length;
if (length <= s)
{
str1 = str1.Substring(0, length) + "…";
}
return str1;
}
#endregion
}
}
我的疑问:为什么我把FormatString定义为public类了,还是会报错呢?
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。
编译器错误消息: CS0122: “DAL.FormatString”不可访问,因为它受保护级别限制
源错误:
行 20: BLL.NewsLogic B_news = new BLL.NewsLogic();
行 21: BLL.BigClassLogic B_bc = new BLL.BigClassLogic();
行 22: DAL.FormatString FString = new DAL.FormatString();
行 23:
行 24: protected void Page_Load(object sender, EventArgs e)
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DAL;
public partial class web_Default2 : System.Web.UI.Page
{
/// <summary>
/// 实例化接口层NewsLogic类的对象
/// </summary>
BLL.NewsLogic B_news = new BLL.NewsLogic();
BLL.BigClassLogic B_bc = new BLL.BigClassLogic();
DAL.FormatString FString = new DAL.FormatString();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DataBindRepeater1();
DataBindRepeaterBigClass();
this.Title = "新闻系统----本系统采用ASP.NET 3.5+SQL Server 2005技术架构!";
Session.Clear();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DAL
{
/// <summary>
/// 字符串处理类
/// </summary>
public class FormatString
{
#region 字符串截取函数
/// <summary>
/// 截取字符串方法
/// </summary>
/// <param name="inputString">要截取的原字符串</param>
/// <param name="len">要截取的长度</param>
/// <returns>截取后的字符串</returns>
public string CutString(string str1, int length)
{
int s = str1.Length;
if (length <= s)
{
str1 = str1.Substring(0, length) + "…";
}
return str1;
}
#endregion
}
}
我的疑问:为什么我把FormatString定义为public类了,还是会报错呢?
作者: linxianfengqq 发布时间: 2011-12-16
你需要重新生成一下
作者: MSDNXGH 发布时间: 2011-12-16
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28