急~~~~~那位高人来解释下啊~有条句子不懂
using System;using
using System.Collections;
public class RecursiveFileProcessor
{
public static void Main(string[] args)
{
foreach (string path in args) \\解释下这里,为什么用args,什么意思啊--------- -------------------------
{
if (File.Exists(path))
{
ProcessFile(path);
}
else if (Directory.Exists(path))
{
ProcessDirectory(path);
}
else
{
Console.WriteLine("{0} is not a valid file or directory.", path);
}
}
}
public static void ProcessDirectory(string targetDirectory)
{
string[] fileEntries = Directory.GetFiles(targetDirectory);
foreach (string fileName in fileEntries)
ProcessFile(fileName);
string[] subdirectoryEntries = Directory.GetDirectories(targetDirectory);
foreach (string subdirectory in subdirectoryEntries)
ProcessDirectory(subdirectory);
}
public static void ProcessFile(string path)
{
Console.WriteLine("Processed file '{0}'.", path);
}
}