Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Empty-directory/C-sharp/empty-directory.cs
Normal file
19
Task/Empty-directory/C-sharp/empty-directory.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main( string[] args )
|
||||
{
|
||||
foreach ( string dir in args )
|
||||
{
|
||||
Console.WriteLine( "'{0}' {1} empty", dir, IsDirectoryEmpty( dir ) ? "is" : "is not" );
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsDirectoryEmpty( string dir )
|
||||
{
|
||||
return ( Directory.GetFiles( dir ).Length == 0 &&
|
||||
Directory.GetDirectories( dir ).Length == 0 );
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue