在C盘的某处找到一个文件夹,或询问用户的路径(输入)

时间:2018-10-16 20:15:02

标签: c# wildcard

到目前为止,这是我要在C驱动器上搜索一个名为“ E”的文件夹的内容,然后如果控制台不在该位置,我希望控制台进行写入。更多评论。或者相反,我如何要求用户输入路径?我该怎么做?谢谢。

namespace Filenames
{
    public class FileName
    {
        public string FileName { get; set; }

    }
}

namespace DuplicateFileFinder
{
    class Program
    {
      static void Main(string[] args)
        {
            string path;

            double totalSize = 0;


            if (args.Length > 0)
                path = args[0] as string;
            else
                path = @"C:\Users\*\Desktop\E";
            //...Throws exception.

//if (path.Exists = false)
       // {
        //    Console.WriteLine(File.Exists(curFile) ?  "Folder does not exist.");
        // }
        //If folder does not exist console.writeline ("Folder does not exist.");

0 个答案:

没有答案
相关问题