Re: Connecting to a UNC share from a web application

From: Paul Clement (UseAdddressAtEndofMessage_at_swspectrum.com)
Date: 01/06/05


Date: Thu, 06 Jan 2005 13:12:06 -0600

On Thu, 6 Jan 2005 07:59:06 -0800, Rasmus <Rasmus@nospam.nospam> wrote:

¤ Basically I want to do the following:
¤
¤ DirectoryInfo baseDirInfo = new DirectoryInfo(@"\\server2\files");
¤ FileInfo[] aFileInfos = baseDirInfo.GetFiles();
¤ string ss = "";
¤ foreach (FileInfo fileInfo in aFileInfos){
¤ ss += fileInfo.Name;
¤ }
¤
¤
¤ But I need a way to supply the username and password – otherwise I’m not
¤ allowed to access the share.
¤
¤ Info:
¤ The web application has anonymous access
¤ No domain
¤ A local user is created on server2
¤ This user has access to share d:\files on server2

Take a look at the below link concerning delegation scenarios:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconaspnetdelegation.asp

Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)



Relevant Pages

  • Re: access files on a UNC virtual directory
    ... I’ve read the transcript of the webcast- and found it most clarifying in ... But it still don’t help me in this special situation. ... FileInfo[] aFileInfos = baseDirInfo.GetFiles; ...
    (microsoft.public.inetserver.iis)
  • Connecting to a UNC share from a web application
    ... FileInfo[] aFileInfos = baseDirInfo.GetFiles; ... A local user is created on server2 ...
    (microsoft.public.dotnet.framework.aspnet.security)

Quantcast