Re: Access Network Share from inside an application.

From: Johnny Fugazzi (removethis-abillmeier_at_ldmkusa.com)
Date: 01/19/05


Date: Wed, 19 Jan 2005 12:31:09 -0600

Thanks for the reply.

I am currently using that code to Impersonate a user that has FULL
permissions on the share, and full permissions on the Files and Folders held
within that share.

After Impersonation (and before undoing the impersonation) I am able to
connect to the subdirectory on the share and verify that folder is visible.
I am also able to write out the contents of the subfolder as a test. The
next step is to open an excel file and read out some values. At this point
it fails saying that the File Cannot be found. I know the file path is
valid. Are there other issues here that I am not aware of?

The code module that creates an Excel.Application object and opens the file
is not instantiated and called until after the Impersonation is successful.
But it still appears like it is trying to open the file using the actual
user's security context, and not the impersonated one.

Any help would be appreaciated.

"Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message
news:%23McAVAL$EHA.3908@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> http://www.dotnet247.com/247reference/msgs/28/144136.aspx
>
> Ken
> ---------------------
> "Johnny Fugazzi" <removethis-abillmeier@ldmkusa.com> wrote in message
> news:uhcu$NK$EHA.3596@TK2MSFTNGP12.phx.gbl...
> I would like to access a network share from my vb.net application. I do
> not
> want to map a drive to the share, however. I would also like to specifiy
> a
> user credential to use when connecting to the share, as the user running
> the
> application will not have security rights to hit the share themselves.
>
> Any pointers on this?
>
>
>
>



Relevant Pages

  • Re: VS.NET 2005 and the "allowDefinition=MachineToApplication" error
    ... Your description of impersonation is great. ... If you want to use the default configured account, eliminate that entry, or configure it as: ... The easiest way to assign correct permissions to all required directories is to run: ... I re-started IIS and tried to access my ASPX page again -- same ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cant Write File on Hosted Server...
    ... Authentication for write permissions can be a tricky thing in a hosted ... I would guess that the hosting provider denies write at some point in the ... impersonation is unlikely to help as you have found. ...
    (microsoft.public.dotnet.general)
  • Re: Fileupload - authorization to directories through code?
    ... You should not be able to set permissions programmatically with asp.net. ... I would think that would be a security risk. ... The FTP user that you log into. ... good tutorial on asp.net user impersonation and understand all of the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Question about Permissions
    ... > thread that would have the permissions matching what ... The topic in question is called "Client ... Impersonation" and is quite broad. ... impersonate the client as the operating system knows full well who is at the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: NTFS + Impersonation + Asp.Net
    ... I set impersonation to true in machine.config. ... I must be sure that he can't RevertToSelf and use the asp.net account. ... > permissions because you still have to give permissions to ... as a test I set NTFS file permisions to refuse ...
    (microsoft.public.dotnet.framework.aspnet.security)