Re: User id of a running Windows form app
From: Nicole Calinoiu (calinoiu)
Date: Thu, 19 May 2005 14:59:25 -0400
Sorry, but you did say "when my program tries to find a folder with a
certain name". <g>
What happens when you try to find the target file via Windows Explorer when
running under the same account as the application? Can you open every
parent folder in the folder hierarchy above the target file? Can you open
the target file itself for reading?
"RD" <email@example.com> wrote in message
>I need to test the existence of a particular file. Thats why I did not use
> Directory.exists. I can try it and add some loging to the functions to see
> what I get back when they execute.
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
>> What happens when you use Directory.Exists rather than File.Exists to
>> the existence of the folder?
>> "RD" <firstname.lastname@example.org> wrote in message
>> > Computer A is running an application that needs to find a certain file
>> > an
>> > FTP site folder that is also on computer A.
>> > The user that is logged on to computer A is the domain administrator
>> > computer runs 24-7 without user interaction)
>> > The FTP site folder the program looks at is restricted access. Only
>> > with the username and password given them and part of the local users
>> > group
>> > can see its contents and download from it or upload to it.
>> > In addition the domain administrators and authenticated users have full
>> > access to the FTP folder.
>> > However when my program tries to find a folder with a certain name, and
>> > can see that it is there and the name and location are correct, the
>> > program
>> > returns false.
>> > The code is
>> > Private Function FileExists(ByVal fileName As String) As Boolean
>> > 'Arguments : fileName - Name & Location of the file to check
>> > 'Returns : True if the caller has the required permissions
>> > ' and path contains the name of an existing file;
>> > ' otherwise, False. This method also returns false
>> > ' if path is a null reference (Nothing in Visual
>> > ' Basic) or a zero-length string.
>> > Return System.IO.File.Exists(fileName)
>> > End Function
>> > Since this function returns True in my test environment where I do not
>> > have
>> > the same restrictions on the FTP test folder My suspicion is that the
>> > caller
>> > does not have appropriate permissions to view the folder's contents.
>> > Question is what permission do I have to set to allow this access to
>> > the
>> > FTP
>> > folder for my application?
>> > Any help would be greatly appreciated.
>> > RD