Inconsistent accessibility: field type 'DannyGeneral.OptionsFile' is less accessible than field 'AnimationEditor.Form1.setting_file'
不太容易接近在Form1我所做的:這個錯誤是什麼意思?可訪問性不一致:字段類型 'DannyGeneral.OptionsFile' 比場「AnimationEditor.Form1
public OptionsFile setting_file;
的錯誤是在setting_file一部分。
這是Options_File代碼的開頭:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Configuration;
namespace DannyGeneral
{
class OptionsFile
{
string path_exe;
string temp_settings_file;
string temp_settings_dir;
string Options_File;
StreamWriter sw;
StreamReader sr;
public OptionsFile(string settings)
{
if (!File.Exists(settings))
{
if (!Directory.Exists(Path.GetDirectoryName(settings)))
{
Directory.CreateDirectory(Path.GetDirectoryName(settings));
}
File.Create(settings).Close();
}
path_exe = Path.GetDirectoryName(Application.LocalUserAppDataPath);
Options_File = settings;
}
而且在Form1上:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using DannyGeneral;
using unfreez_wrapper;
namespace AnimationEditor
{
public partial class Form1 : Form
{
private static string settings_dir;
private static string settings_file;
public OptionsFile setting_file;
@ 500 - 內部給你答案,但如果你一點牢記don'r有一個修飾符(例如)public,那麼VS中的'box默認值就是內部的。 – 2012-07-05 21:10:34