[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]System.IO.Directory compile error
From: |
CH Gowri Kumar |
Subject: |
Re: [DotGNU]System.IO.Directory compile error |
Date: |
Mon, 3 Mar 2003 00:06:08 +0530 (IST) |
> Perhaps I've gone brain-dead, but I don't understand why I get this compiler
> error. Any help appreciated.
"using" directive is used to import the name spaces but not the
classes.(Directory is a class in System.IO)
Remove the line "using system.IO.Directory" and you should be able to run
the program.
Regards,
Gowri Kumar
> TIA,
> Jeff
>
> // compiled with "cscc -lSystem -o dir.exe dir.cs
> // gives error "called object is not a method or delegate"
>
> using System;
> using System.IO;
> using System.IO.Directory;
>
> namespace DIRECTORYTEST
> {
> class MainClass
> {
> static int Main(string[] args)
> {
> string thisDir =
> System.IO.Directory.GetCurrentDirectory();
> // error with GetCurrentDirectory() - not method or delegate
> Console.WriteLine("Current directory: {0}", thisDir);
> return 0;
> }
> }
> }