Tôi nhận được thông báo "Đã phát hiện mã không truy cập được" trong Visual Studio tại điểm i + + trong mã của tôi bên dưới. Bạn có thể phát hiện ra những gì tôi đã làm sai?C# Mã không thể truy cập được phát hiện
try
{
RegistryKey OurKey = Registry.CurrentUser;
OurKey.CreateSubKey("Software\\Resources\\Shared");
OurKey = OurKey.OpenSubKey("Software\\Resources\\Shared", true);
for (int i = 0; i < cmbPaths.Items.Count; i++) //<---- problem with i
{
OurKey.SetValue("paths" + i, cmbPaths.Items[i]);
break;
}
}
Rất cám ơn Juri. – Jamie