91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 11.29MB
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發布日期: 2023-07-28
  • 語言: 其他
  • 標簽: c++??shell??

資源簡介

開發的Shell程序支持以下命令: 1)cd ——將當前默認目錄改變為。如果沒有參數,則顯示當前目錄;如果目錄不存在,會出現合適的錯誤信息提示。 2)clr——清屏 3)dir ——列出目錄的內容 4)environ——列出所有的環境變量 5)echo ——在屏幕上顯示并換行 6)help——顯示用戶手冊,并使用more命令過濾 7)pause——停止Shell存在直到按下回車鍵 8)quit——退出Shell 9)其它的命令行輸入被解釋為程序調用,Shell創建并執行這個程序。

資源截圖

代碼片段和文件信息

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include?
#define?PAGELEN?24
#define?LINELEN?512
#define?BUFSIZE?MAX_PATH
char?buf[BUFSIZE];
char?path[BUFSIZE];
int?main(int?argc?char?*argv[])
{
void?cd_cmd(char?*dir);
void?dir_cmd(char?*dir);
void?clr_cmd();
void?environ_cmd();
void?echo_cmd(char?*comment);
void?help_cmd();
int?pause_cmd();
void?quit_cmd();
void?otherOpration(char?*dir);

char?c*input*arg[2];
char?*other;
int?inputlen=0is_bg=0ij=0k;
DWORD?dwRet;

printf(“Oprating?System?Shell?[版本?1.0]\n版權所有?2013?YU?YING?ZUO。保留所有權利。\n“);
char?*?str=“C:\\Users\\Administrator“;
strcpy(pathstr);
SetCurrentDirectoryA(path);
while(true)
{
for(i=0;i<2;i++)
arg[i]=NULL;
????dwRet=GetCurrentDirectoryA(BUFSIZEpath);
if(dwRet==0)
{
//返回當前目錄失敗,輸出出錯信息
printf(“GetCurrentDirectory?failed.\n“);
}
else?if(dwRet>BUFSIZE)
{
printf(“GetCurrentDirectory?failed(buffer?too?small;need%d?chars)\n“dwRet);
}
else
printf(“\n%s>“path);

????/**********輸入***********/
inputlen=0;
????//過濾無用字符
????while((c=getchar())==‘?‘||c==‘\n‘||c==‘\t‘||c==EOF)
if(c==‘\n‘)
continue;
while(c!=‘\n‘)
{
buf[inputlen++]=c;
c=getchar();
}
buf[inputlen++]=‘\0‘;

//將命令從緩存復制到input中
input=(char*)malloc(sizeof(char)*(inputlen));
other=(char*)malloc(sizeof(char)*(inputlen));
strcpy(inputbuf);
strcpy(otherbuf);


/**********解析指令***********/
for(i=0j=0k=0;i {
if(input[i]==‘?‘||input[i]==‘\0‘)
{
if(j==0)???//去掉多余空格
continue;
else
{
buf[j++]=‘\0‘;
arg[k]=(char*)malloc(sizeof(char)*j);
strcpy(arg[k++]buf);
j=0;
}
}
else
buf[j++]=input[i];

}

/**********處理命令***********/
???? //cd
???? if(strcmp(arg[0]“cd“)==0||strcmp(arg[0]“CD“)==0)
???? {
for(i=3j=0;i buf[j++]=input[i];
buf[j]=‘\0‘;
arg[1]=(char*)malloc(sizeof(char)*j);
strcpy(arg[1]buf);
if(arg[1]==NULL)
???? cd_cmd(path);
else
cd_cmd(arg[1]);
free(input);
continue;
???? }
//dir
else?if(strcmp(arg[0]“dir“)==0||strcmp(arg[0]“DIR“)==0)
{
char*?route;
if(arg[1]==NULL)
{
route=path;
dir_cmd(route);
}
else
dir_cmd(arg[1]);
free(input);
continue;
}
//clr清屏
else?if(strcmp(arg[0]“clr“)==0||strcmp(arg[0]“CLR“)==0)
??? {
clr_cmd();
free(input);
continue;
}
//environ獲取所有環境變量
else?if(strcmp(arg[0]“environ“)==0||strcmp(arg[0]“ENVIRON“)==0)
????{
???environ_cmd();
???free(input);
???continue;
}
??? ????//echo?顯示comment并換行
else?if(strcmp(arg[0]“echo“)==0||strcmp(arg[0]“ECHO“)==0)
????{
for(i=5j=0;i buf[j++]=input[i];
????buf[j]=‘\0‘;
????arg[1]=(char*)malloc(

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????35328??2013-11-08?13:38??myshell\Debug\myshell.exe

?????文件?????397272??2013-11-08?13:38??myshell\Debug\myshell.ilk

?????文件?????543744??2013-11-08?13:38??myshell\Debug\myshell.pdb

?????文件???????1133??2013-11-08?01:04??myshell\Debug\shellhelp.txt

?????文件???33619968??2013-11-18?14:22??myshell\ipch\myshell-5903f905\myshell-acfa900a.ipch

?????文件????????586??2013-11-08?13:38??myshell\myshell\Debug\cl.command.1.tlog

?????文件??????13706??2013-11-08?13:38??myshell\myshell\Debug\CL.read.1.tlog

?????文件????????238??2013-11-08?13:38??myshell\myshell\Debug\CL.write.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.20520-cvtres.read.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.20520-cvtres.write.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.20520.read.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.20520.write.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.8200-cvtres.read.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.8200-cvtres.write.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.8200.read.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.8200.write.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.8548-cvtres.read.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.8548-cvtres.write.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.8548.read.1.tlog

?????文件??????????2??2013-11-08?13:38??myshell\myshell\Debug\link.8548.write.1.tlog

?????文件???????1308??2013-11-08?13:38??myshell\myshell\Debug\link.command.1.tlog

?????文件???????2808??2013-11-08?13:38??myshell\myshell\Debug\link.read.1.tlog

?????文件????????548??2013-11-08?13:38??myshell\myshell\Debug\link.write.1.tlog

?????文件????????350??2013-11-08?13:38??myshell\myshell\Debug\mt.command.1.tlog

?????文件????????250??2013-11-08?13:38??myshell\myshell\Debug\mt.read.1.tlog

?????文件????????250??2013-11-08?13:38??myshell\myshell\Debug\mt.write.1.tlog

?????文件???????3005??2013-11-07?23:51??myshell\myshell\Debug\myshell.Build.CppClean.log

?????文件????????406??2013-11-07?23:51??myshell\myshell\Debug\myshell.exe.embed.manifest

............此處省略27個文件信息

評論

共有 條評論