本文介绍了C#编译错误:“X是人迹罕至,由于其保护级别”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C#中给出了这样的编译错误?
private void Form1_Load(object sender, EventArgs e)
{
Favorites objFavorites = new Favorites();
objFavorites.ScanFavorites();
foreach (WebFavorite objWebFavorite in objFavorites.FavoriteCollection)
{
ListViewItem objListViewItem = new ListViewItem();
objListViewItem.Text = objWebFavorite.Name;
objListViewItem.SubItems.Add(objWebFavorite.Url);
lstFavorites.Items.Add(objListViewItem);
}
}
解决方案
This compile-time error means that the property you are trying to access is not public
and the only way to access it is by either modifying its access modifier or using reflection.
这篇关于C#编译错误:“X是人迹罕至,由于其保护级别”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!