.NETGURU
System.IO.Directory.GetFiles
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngsec' list.


Russ Nemhauser
-- Moved from [aspngfreeforall] to [aspngsec] by Tim Musschoot <Click here to reveal e-mail address> --

Does anyone know why I'd get "Could not find a part of the path" and
"Incorrect login" errors when I attempt to call the
System.IO.Directory.GetFiles routine?

I've taken off anonymous access (meaning that I'd HAVE to be authenticated
with my domain credentials since that's how I'm logged in) and it still
bombs out when I attempt to run this routine with the path

\\MYSERVER\MyShare

Thanks,
Russ

P.S. Yes, my user account DOES have full control over that share.

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

Reply to this message...
 
    
Carlos Magalhaes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2652.35">
<TITLE>RE: [aspngsec] System.IO.Directory.GetFiles</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi Russ,</FONT>
</P>

<P><FONT SIZE=3D2>That error means that the process that .Net is =
running as (usually as MACHINENAME\ASPNET) does not have permissions on =
that share.</FONT></P>

<P><FONT SIZE=3D2>So if your machine name was test you would have a =
local user called test\aspnet that user needs to have permission on the =
share but because on a MS network you can not give a local user rights =
on a remote share trying to give text\aspnet rights on the share would =
not work so, what you need to do is give a specific user(domain user) =
rights to the folder (at least read if you want to get the attributes =
or write to create the file) Then you would use impersonation in your =
web.config(You need to specify Domain username and password) or use an =
example from Ambrose Little (very good impersonation example but you =
have to get hold of him on this Newsgroup some how) that calls some =
API's to your page and impersonates the user.</FONT></P>

<P><FONT SIZE=3D2>Once you have impersonated the user you then have =
that domain users rights on the folder you are trying to reach.</FONT>
</P>

<P><FONT SIZE=3D2>Hope you come right.</FONT>
</P>

<P><FONT SIZE=3D2>Carlos</FONT>
</P>

<P><FONT SIZE=3D2> </FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Russ Nemhauser [<A =
HREF=3D"mailto:Click here to reveal e-mail address">mailto:Click here to reveal e-mail address</A>] =
</FONT>
<BR><FONT SIZE=3D2>Sent: Tuesday, July 02, 2002 6:00 PM</FONT>
<BR><FONT SIZE=3D2>To: aspngsec</FONT>
<BR><FONT SIZE=3D2>Subject: [aspngsec] =
System.IO.Directory.GetFiles</FONT>
</P>

<P><FONT SIZE=3D2>-- Moved from [aspngfreeforall] to [aspngsec] by Tim =
Musschoot <Click here to reveal e-mail address> --</FONT>
</P>

<P><FONT SIZE=3D2>Does anyone know why I'd get "Could not find a =
part of the path" and </FONT>
<BR><FONT SIZE=3D2>"Incorrect login" errors when I attempt to =
call the </FONT>
<BR><FONT SIZE=3D2>System.IO.Directory.GetFiles routine?</FONT>
</P>

<P><FONT SIZE=3D2>I've taken off anonymous access (meaning that I'd =
HAVE to be authenticated </FONT>
<BR><FONT SIZE=3D2>with my domain credentials since that's how I'm =
logged in) and it still </FONT>
<BR><FONT SIZE=3D2>bombs out when I attempt to run this routine with =
the path</FONT>
</P>

<P><FONT SIZE=3D2>\\MYSERVER\MyShare</FONT>
</P>

<P><FONT SIZE=3D2>Thanks,</FONT>
<BR><FONT SIZE=3D2>Russ</FONT>
</P>

<P><FONT SIZE=3D2>P.S. Yes, my user account DOES have full control over =
that share.</FONT>
</P>

<P><FONT =
SIZE=3D2>_______________________________________________________________=
__</FONT>
<BR><FONT SIZE=3D2>Join the world's largest e-mail service with MSN =
Hotmail. </FONT>
<BR><FONT SIZE=3D2><A HREF=3D"http://www.hotmail.com"" target="_blank">http://www.hotmail.com"; =
TARGET=3D"_blank">http://www.hotmail.com</A></FONT>
</P>

<P><FONT SIZE=3D2>| [aspngsec] member Click here to reveal e-mail address =3D YOUR =
ID</FONT>
<BR><FONT SIZE=3D2>| <A =
HREF=3D"http://www.asplists.com/asplists/aspngsec.asp"" target="_blank">http://www.asplists.com/asplists/aspngsec.asp"; =
TARGET=3D"_blank">http://www.asplists.com/asplists/aspngsec.asp</A> =3D =
JOIN/QUIT</FONT>
<BR><FONT SIZE=3D2>| <A HREF=3D"http://www.asplists.com/search"" target="_blank">http://www.asplists.com/search"; =
TARGET=3D"_blank">http://www.asplists.com/search</A> =3D SEARCH =
Archives</FONT>
</P>

</BODY>
</HTML>

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

Reply to this message...
 
 
System.IO.Directory




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification