Hi,
I am trying to understand why the compiler wants an object?
Any help would be great.
Thank you
static void Main(string[] args)
{
int counter = 0;
string sDir = "c:\\";
DirSearch(sDir);// <-------Here.
}
void DirSearch(string sDir)
{
try
{
foreach (string d in Directory.GetDirectories(sDir))
{
foreach (string f in Directory.GetFiles(d,"test.txt"))
{
Console.WriteLine(f);
}
DirSearch(d);
}
}
catch (System.Exception excpt)
{
Console.WriteLine(excpt.Message);
}
}
I am trying to understand why the compiler wants an object?
Any help would be great.
Thank you
static void Main(string[] args)
{
int counter = 0;
string sDir = "c:\\";
DirSearch(sDir);// <-------Here.
}
void DirSearch(string sDir)
{
try
{
foreach (string d in Directory.GetDirectories(sDir))
{
foreach (string f in Directory.GetFiles(d,"test.txt"))
{
Console.WriteLine(f);
}
DirSearch(d);
}
}
catch (System.Exception excpt)
{
Console.WriteLine(excpt.Message);
}
}