Inconsistent accessibility: field type 'DannyGeneral.OptionsFile' is less accessible than field 'AnimationEditor.Form1.setting_file'
在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;