Exemplo n.º 1
0
    public static void LoadLocalClasses()
    {
        FileInfo Classes = new FileInfo(Application.dataPath + "/" + ClassFile + ".txt");

        if (Classes.Exists)
        {
            AllmyClasses = mytxtIO.StraightString(ClassFile);//明文读取课程信息,若读取失败改从AllStatics中读取
        }
        else
        {
            AllmyClasses = AllStatics.DefaultClassesInfo;
        }
        for (int i = 0; i < AllmyClasses.ToArray().Length; i++)
        {
            ForAddLesson.CourseName  = AllmyClasses[i];
            ForAddLesson.CourseNum   = int.Parse(AllmyClasses[++i]);
            ForAddLesson.CourseType  = int.Parse(AllmyClasses[++i]);
            ForAddLesson.ContentType = int.Parse(AllmyClasses[++i]);
            ForAddLesson.Contents    = AllmyClasses[++i];
            i++;
            ForAddLesson.NextClass = AllmyClasses[i] == "null" ? null : AllmyClasses[i];
            ForAddLesson.AddToLessonsList();
        }
    }