/// <summary>
 /// 書き込む。
 /// </summary>
 /// <param name="file_object">version_checkオブジェクト、そっちで作ってください。</param>
 /// <param name="settings_object">設定オブジェクト。</param>
 public static void save_file(version_check file_object, v0_1.root settings_object)
 {
     using (MemoryStream ms = new MemoryStream())
     {
         BinaryFormatter f = new BinaryFormatter();
         f.Serialize(ms, settings_object);
         file_object.data = Convert.ToBase64String(ms.ToArray());
     }
     using (FileStream fs = new FileStream(Program.directory_path + @"\common\settings.dat", FileMode.Create, FileAccess.Write))
     {
         BinaryFormatter f = new BinaryFormatter();
         f.Serialize(fs, file_object);
     }
 }
        /// <summary>
        /// 読み込む。エラーの場合は初期化して書き込む。
        /// </summary>
        /// <returns>そしてオブジェクトが返ってくる。</returns>
        static public v0_1.root read_file()
        {
            version_check file_object;
            v0_1.root settings_object;
            if (Program.file_check(@"\common\settings.dat"))
            {
                byte[] data;
                using (FileStream fs = new FileStream(Program.directory_path + @"\common\settings.dat", FileMode.Open, FileAccess.Read))
                {
                    int file_size = (int)fs.Length;
                    data = new byte[file_size];

                    int read_size;
                    int remain = file_size;
                    int buf_pos = 0;
                    while (remain > 0)
                    {
                        read_size = fs.Read(data, buf_pos, Math.Min(1024, remain));

                        buf_pos += read_size;
                        remain -= read_size;
                    }
                }
                using (MemoryStream ms = new MemoryStream(data))
                {
                    BinaryFormatter f = new BinaryFormatter();
                    file_object = (version_check)f.Deserialize(ms);
                }
                if (file_object.version == "0.1")
                {
                    using (MemoryStream ms = new MemoryStream(Convert.FromBase64String(file_object.data)))
                    {
                        BinaryFormatter f = new BinaryFormatter();
                        settings_object = (v0_1.root)f.Deserialize(ms);
                    }
                    return settings_object;
                }
            }
            settings_object = new v0_1.root();
            file_object = new version_check();
            save_file(file_object, settings_object);
            return new v0_1.root();
        }