2024年3月13日发(作者:)

{

23

Size += DirSize(di);

24

}

25

return(Size);

26

}

27

public

static

void

Main(string[] args)

28

{

29

if

( != 1)

30

31

32

33

34

35

{

ine("You must provide a directory argument at the command line.");

}

else

{

DirectoryInfo d = new

DirectoryInfo(args[0]);

long

dsize = DirSize(d);

36

ine("The size of {0} and its subdirectories is {1} bytes.", d, dsize);

37

}

38

}

39

}

40