Scott
Fri Mar 25 14:11:30 CST 2005
You must make an instance of the "directory" class before you can use it.
Dim theDirectory As New Directory
If theDirectory.Exists("c:/") Then....
"Kiran Kumar Pinjala" <KiranKumarPinjala@discussions.microsoft.com> wrote in
message news:DACB717C-6121-4134-AC0C-2DF3F2A9DD4F@microsoft.com...
> Hi, Here it is, When I use this in a normal application it works, But I am
> writing a windows service, that gets files from a particular directory. It
> works on some machines and does not work fine on others like the
> Pre-Production server, which is identical to the Integration server.
>
> IF (Directory.Exists("C:\") THEN
> 'Do Some stuff Here
> Else
> 'Do Some other stuff here.
> End If
>
> Thanks
> Kiran
>
> "Mattias Sjögren" wrote:
>
>> >Hi I am using the Directory object in the System.IO Namespace. When I
>> >use the
>> >following code It gives me Object reference not set to an instance of an
>> >object. Can Anyone tell me what I am doing wrong?
>> >
>> > The line is Direcotry.exists("C:\")
>>
>>
>> Please post a complete code snippet that reproduces the error you're
>> getting.
>>
>>
>>
>> Mattias
>>
>> --
>> Mattias Sjögren [MVP] mattias @ mvps.org
>>
http://www.msjogren.net/dotnet/ |
http://www.dotnetinterop.com
>> Please reply only to the newsgroup.
>>