Home All Groups Group Topic Archive Search About

User id of a running Windows form app

Author
18 May 2005 4:04 PM
RD
Computer A is running an application that needs to find a certain file in an
FTP site folder that is also on computer A.
The user that is logged on to computer A is the domain administrator (the
computer runs 24-7 without user interaction)
The FTP site folder the program looks at is restricted access. Only users
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 I
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

Author
18 May 2005 6:34 PM
Nicole Calinoiu
What happens when you use Directory.Exists rather than File.Exists to test
the existence of the folder?


Show quoteHide quote
"RD" <nospam@nospam.net> wrote in message
news:%23XIAxN8WFHA.3864@tk2msftngp13.phx.gbl...
> Computer A is running an application that needs to find a certain file in
> an
> FTP site folder that is also on computer A.
> The user that is logged on to computer A is the domain administrator (the
> computer runs 24-7 without user interaction)
> The FTP site folder the program looks at is restricted access. Only users
> 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 I
> 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
>
>
Author
19 May 2005 2:25 PM
RD
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.

RD

Show quoteHide quote
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:OV8XPh9WFHA.3532@TK2MSFTNGP10.phx.gbl...
> What happens when you use Directory.Exists rather than File.Exists to test
> the existence of the folder?
>
>
> "RD" <nospam@nospam.net> wrote in message
> news:%23XIAxN8WFHA.3864@tk2msftngp13.phx.gbl...
> > Computer A is running an application that needs to find a certain file
in
> > an
> > FTP site folder that is also on computer A.
> > The user that is logged on to computer A is the domain administrator
(the
> > computer runs 24-7 without user interaction)
> > The FTP site folder the program looks at is restricted access. Only
users
> > 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
I
> > 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
> >
> >
>
>
Author
19 May 2005 6:59 PM
Nicole Calinoiu
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?


Show quoteHide quote
"RD" <nospam@nospam.net> wrote in message
news:u84cM7HXFHA.2996@TK2MSFTNGP10.phx.gbl...
>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.
>
> RD
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
> news:OV8XPh9WFHA.3532@TK2MSFTNGP10.phx.gbl...
>> What happens when you use Directory.Exists rather than File.Exists to
>> test
>> the existence of the folder?
>>
>>
>> "RD" <nospam@nospam.net> wrote in message
>> news:%23XIAxN8WFHA.3864@tk2msftngp13.phx.gbl...
>> > Computer A is running an application that needs to find a certain file
> in
>> > an
>> > FTP site folder that is also on computer A.
>> > The user that is logged on to computer A is the domain administrator
> (the
>> > computer runs 24-7 without user interaction)
>> > The FTP site folder the program looks at is restricted access. Only
> users
>> > 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
> I
>> > 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
>> >
>> >
>>
>>
>
>
Author
18 May 2005 8:11 PM
Yunus Emre ALPÖZEN [MCAD.NET]
Dow do u access ftp folder ?? Writing full path like C:\Inetpub\ftproot\ ?
Otherwise it uses network security zone instead of using local security
zone...

--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

Show quoteHide quote
"RD" <nospam@nospam.net> wrote in message
news:%23XIAxN8WFHA.3864@tk2msftngp13.phx.gbl...
> Computer A is running an application that needs to find a certain file in
> an
> FTP site folder that is also on computer A.
> The user that is logged on to computer A is the domain administrator (the
> computer runs 24-7 without user interaction)
> The FTP site folder the program looks at is restricted access. Only users
> 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 I
> 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
>
>
Author
19 May 2005 2:23 PM
RD
Yeah, I'm using the full local path
c:\inetpub\ftproot\myFTPSitefoldername\myfilename to try to find the file.

This morning again at the prescribed time it tried to find the file and it
in the folder OK,  but the function looking for it returned false, it could
not find it again.

It sure looks like a permission problem, cause I have exactly the same
folder structure and files on my development machine and it works fine
there. Darn.....

RD



Show quoteHide quote
"Yunus Emre ALPÖZEN [MCAD.NET]" <ye***@msakademik.net> wrote in message
news:OiNTAX%23WFHA.3760@TK2MSFTNGP15.phx.gbl...
> Dow do u access ftp folder ?? Writing full path like C:\Inetpub\ftproot\ ?
> Otherwise it uses network security zone instead of using local security
> zone...
>
> --
>
> Thanks,
> Yunus Emre ALPÖZEN
> BSc, MCAD.NET
>
> "RD" <nospam@nospam.net> wrote in message
> news:%23XIAxN8WFHA.3864@tk2msftngp13.phx.gbl...
> > Computer A is running an application that needs to find a certain file
in
> > an
> > FTP site folder that is also on computer A.
> > The user that is logged on to computer A is the domain administrator
(the
> > computer runs 24-7 without user interaction)
> > The FTP site folder the program looks at is restricted access. Only
users
> > 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
I
> > 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
> >
> >
>
>
Author
23 May 2005 3:46 PM
RD
Thanks to all of you , I worked it out, was an error in my code.
I was looking for a file without giving it the full pathname only the
filename.

DUMB!

Sorry to have bothered you.
RD
Show quoteHide quote
"RD" <nospam@nospam.net> wrote in message
news:%23XIAxN8WFHA.3864@tk2msftngp13.phx.gbl...
> Computer A is running an application that needs to find a certain file in
an
> FTP site folder that is also on computer A.
> The user that is logged on to computer A is the domain administrator (the
> computer runs 24-7 without user interaction)
> The FTP site folder the program looks at is restricted access. Only users
> 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 I
> 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
>
>