操作系统文件管理实验报告文档格式.docx

上传人:b****3 文档编号:6791489 上传时间:2023-05-07 格式:DOCX 页数:16 大小:53.22KB
下载 相关 举报
操作系统文件管理实验报告文档格式.docx_第1页
第1页 / 共16页
操作系统文件管理实验报告文档格式.docx_第2页
第2页 / 共16页
操作系统文件管理实验报告文档格式.docx_第3页
第3页 / 共16页
操作系统文件管理实验报告文档格式.docx_第4页
第4页 / 共16页
操作系统文件管理实验报告文档格式.docx_第5页
第5页 / 共16页
操作系统文件管理实验报告文档格式.docx_第6页
第6页 / 共16页
操作系统文件管理实验报告文档格式.docx_第7页
第7页 / 共16页
操作系统文件管理实验报告文档格式.docx_第8页
第8页 / 共16页
操作系统文件管理实验报告文档格式.docx_第9页
第9页 / 共16页
操作系统文件管理实验报告文档格式.docx_第10页
第10页 / 共16页
操作系统文件管理实验报告文档格式.docx_第11页
第11页 / 共16页
操作系统文件管理实验报告文档格式.docx_第12页
第12页 / 共16页
操作系统文件管理实验报告文档格式.docx_第13页
第13页 / 共16页
操作系统文件管理实验报告文档格式.docx_第14页
第14页 / 共16页
操作系统文件管理实验报告文档格式.docx_第15页
第15页 / 共16页
操作系统文件管理实验报告文档格式.docx_第16页
第16页 / 共16页
亲,该文档总共16页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

操作系统文件管理实验报告文档格式.docx

《操作系统文件管理实验报告文档格式.docx》由会员分享,可在线阅读,更多相关《操作系统文件管理实验报告文档格式.docx(16页珍藏版)》请在冰点文库上搜索。

操作系统文件管理实验报告文档格式.docx

对文件必须设置保护措施,例如只能执行,允许读等。

在每次打开文件时,根据本次打开的要求,在此设置保护级别,即有二级保护。

文件的操作至少有Create、delete、open、close、read、write等命令。

所编写的程序应采用二级文件目录,即设置主文件目录和用户文件目录。

前者应包含文件主及它们的目录区指针;

后者应给出每个文件占有的文件目录,即文件名,保护码,文件长度以及它们存放的位置等。

另外为打开文件设置运行文件目录(AFD),在文件打开时应填入打开文件号,本次打开保护码和读写指针等。

程序流程图:

逻辑设计:

使用线性数组表表示MFD,泛型数组表示UFD,每个元素包括用户ID、保存的文件数、再使用线性表表示文件信息,每个元素包括文件名,文件属性(保护码),文件的状态等信息。

物理设计:

//主目录

privateFileUser[]mfd;

//当前用户

privateFileUsercurrentuser;

///<

summary>

///文件

/summary>

publicclassFileObject{

publicstringfilename;

publicintsize=20;

publicintread=0;

publicintwrite=0;

publicstringauthor;

}

///文件系统用户

publicclassFileUser{

publicstringusername;

publicList<

FileObject>

ufd=newList<

();

publicintfilecount=0;

步骤详述:

1、主目录及用户目录机构显示:

2、当前操作用户登录:

3、文件管理系统菜单:

4、create命令:

5、open命令:

6、close命令:

7、delete命令:

8、read命令

9、write命令

10、exit命令

四、实验总结

通过这次的课程设计使我认识到要将操作系统这门计算机专业的课学好不仅仅是要把书上的基本知识学好而且还要不断进行实践,将所学的跟实践操作结合起来才能更好地巩固所学,才能提高自己实践能力.通过这次的设计使我认识到只停留在表面理解问题是很难使问题得到很好的解决的,实践能力与理论知识同样重要。

可以说此课程设计的理论难度并不大,但是若要深入发掘其中的东西,并且实际去编程实现,就遇到了相当大的难度。

因为与之涉及的很多方面并没有学过,需要自己去自学和实践检验。

五、程序清单

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Text;

namespacefilemanagesystem

{

classProgram

{

staticvoidMain(string[]args)

//初始化用户自模拟文件系统

ExplorerInUserexplorer=newExplorerInUser();

///<

///文件管理系统for用户自模拟

publicclassExplorerInUser

//命令列表

privatestring[]command={"

create"

"

open"

close"

delete"

read"

write"

"

exit"

};

//主目录

privateFileUser[]mfd;

//当前用户

privateFileUsercurrentuser;

///构造函数

publicExplorerInUser()

INI();

///初始化系统

privatevoidINI()

if(currentuser==null)

//主目录实现

IniUserList();

//系那是菜单

InilizeMenu();

boolisinput=false;

//输入正确的命令

while(!

isinput)

stringinput=Console.ReadLine();

isinput=CommandGroup(input);

#region主目录

///获取用户个数

returns>

<

/returns>

privateintGetUserCount()

try

intuser_size=Convert.ToInt32(input);

returnuser_size;

catch(Exceptione)

Console.WriteLine(e.Message);

return0;

///生成用户及用户管理文件

privatevoidIniUserList()

intuser_size=GetUserCount();

mfd=newFileUser[user_size];

for(inti=0;

i<

user_size;

i++)

mfd[i]=newFileUser();

mfd[i].username="

mfd_user_"

+i;

mfd[i].filecount=3;

Console.WriteLine("

mfd:

"

+mfd[i].username+"

+mfd[i].filecount);

for(intj=0;

j<

3;

j++)

FileObjectfile=newFileObject();

file.author=mfd[i].username;

--ufd:

+file.filename+"

+file.size+"

+file.author);

file.filename="

file"

+j;

mfd[i].ufd.Add(file);

IniLogin();

///用户登录

privatevoidIniLogin()

请输入用户名:

);

boolissuccess=false;

issuccess)

stringusername=Console.ReadLine();

mfd.Length;

if(mfd[i].username.Equals(username))

issuccess=true;

currentuser=mfd[i];

当前用户:

+username);

break;

if(!

请重新输入输入用户名:

#endregion

#region菜单

///初始化菜单

privatevoidInilizeMenu()

欢迎进入文件管理系统!

------create-------"

------open---------"

------close--------"

------delete-------"

------read---------"

------write--------"

------exit---------"

请输入操作命令:

///功能分组判断

paramname="

command"

>

/param>

privateboolCommandGroup(stringcommand)

boolisexit=true;

switch(command)

case"

:

create();

open();

close();

delete();

read();

write();

exit();

returntrue;

default:

isexit=false;

if(isexit){INI();

else{Console.WriteLine("

请重新输入操作命令:

returnisexit;

#region操作命令方法

///创建新的文件

privatevoidcreate()

请输入新件名:

stringfilename=Console.ReadLine();

currentuser.filecount++;

FileObjectfile=newFileObject();

file.filename=filename;

file.author=currentuser.username;

currentuser.ufd.Add(file);

成功创建文件!

///打开指定的文件

privatevoidopen(){

请输入文件名:

currentuser.ufd.Count;

if(currentuser.ufd[i].filename.Equals(filename))

成功打开文件!

ID:

+i);

FileName:

+filename);

Size:

+currentuser.ufd[i].size);

Autor:

+currentuser.ufd[i].author);

return;

}Console.WriteLine("

文件不存在!

///关闭所有打开的文件

privatevoidclose(){

已关闭文件"

///删除文件

privatevoiddelete()

currentuser.ufd.RemoveAt(i);

成功删除文件!

///读取文件

privatevoidread(){

已读取文件!

///写入文件

privatevoidwrite(){

已写入文件!

///退出系统

privatevoidexit(){

您好,您已经成功退出系统!

Console.ReadKey();

///文件

///文件系统用户

}

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 法律文书 > 调解书

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2