System.UnauthorizedAccessException

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Peter Afonin (peter_at_gudzon.net)
Date: 09/07/04


Date: Tue, 7 Sep 2004 16:40:36 -0700

Hello,

I'm using this code to access a network share from an asp.net page:

Dim dir As DirectoryInfo = New DirectoryInfo("\\10.0.0.150\FormLib\")
Dim files() As FileInfo = dir.GetFiles("*.eps")

When I try to do it, I get this error:

System.UnauthorizedAccessException: Access to the path
"\\10.0.0.150\FormLib\" is denied. at System.IO.__Error.WinIOError(Int32
errorCode, String str) at
System.IO.Directory.InternalGetFileDirectoryNames(String fullPath, String
userPath, Boolean file) at System.IO.Directory.InternalGetFiles(String path,
String userPath, String searchPattern) at
System.IO.DirectoryInfo.GetFiles(String searchPattern) at
Wip7b.WorkInProcess.btnGetEPS_ServerClick(Object sender, EventArgs e)

All permissions to this folder and a file share are set to Everyone.Usually
I don't have this problem. The only thing that is different about this
particular machine that it is not a part of the domain to which all other
PCs in our company belong, so I cannot access any users from our Active
Directory.

This is a Win 2000 SP4 machine.

I would greatly appreciate your help.

Thank you,

-- 
Peter


Relevant Pages

  • Re: console app command line args
    ... the behavior is strange. ... many files are selected when the app is run. ... Dim files As String= Environment.GetCommandLineArgs ... For Each s As String In My.Application.CommandLineArgs ...
    (microsoft.public.dotnet.languages.vb)
  • RE: console app command line args
    ... the post "Opening multiple files with my application". ... many files are selected when the app is run. ... Dim files As String= Environment.GetCommandLineArgs ... For Each s As String In My.Application.CommandLineArgs ...
    (microsoft.public.dotnet.languages.vb)
  • System.UnauthorizedAccessException
    ... Dim files() As FileInfo = dir.GetFiles ... System.IO.Directory.InternalGetFileDirectoryNames(String fullPath, String ... String userPath, String searchPattern) at ... This is a Win 2000 SP4 machine. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Change File extension
    ... "Replace" is used to replace a character in a string. ... changing the String where you are storing the file name. ... Dim fil As String ...
    (microsoft.public.dotnet.languages.vb)
  • Impersonation and UNC shares in a windows service
    ... a Win3k server not connected to a domain, as a local user. ... fullPath, String userPath, Boolean file) at ... userPath, String searchPattern) at ... under a local account with the same user name/pwd or if the ...
    (microsoft.public.dotnet.security)