我正在尝试获取使用数组获取的目录树的倒数第二级。当它到达 Console.WriteLine 部分时,它不显示任何内容,似乎跳过了整行。
foreach (string file in files)
{
string thepathoflife = Path.GetFullPath(file);
string filetocopy = file;
string location = file;
bool b = false;
string extension = Path.GetExtension(file);
string thenameofdoom = Path.GetFileNameWithoutExtension(file);
string filename = Path.GetFileName(file);
//here is my attempt
string dirthing = Path.GetDirectoryName(filename); //here is my attempt
System.Console.WriteLine("" + dirthing); //here is my attempt