M
Me InCA via .NET 247
The following is the error I get on my Intranet site. IIS 5.0,.NET 1.0
Error Type: System.UnauthorizedAccessException
Error Message: Access to the path "\\FILESERVER101\Budget\BudgetBasics" is denied.
Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode,String str) atSystem.IO.Directory.InternalGetFileDirectoryNames(StringfullPath, Boolean file) atSystem.IO.DirectoryInfo.GetDirectories(String searchPattern) atSystem.IO.DirectoryInfo.GetDirectories()
I have a Virtual Directory called "Bulletins" pointing to a shareon another machine \\FILESERVER101\Budget.
The following is the code in the aspx.vb
Dim impersonationContext AsSystem.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity AsSystem.Security.Principal.WindowsIdentity
currentWindowsIdentity = CType(User.Identity,System.Security.Principal.WindowsIdentity)
impersonationContext =currentWindowsIdentity.Impersonate()
sPath = "Bulletins" & "\Budget Basics\"
'Server.MapPath (check in IIS)
dir = New DirectoryInfo(Server.MapPath(sPath))
'Get the sub directories
dirs = dir.GetDirectories()
dir.GetDirectories()
For Each subDir In dirs
....
....
Any help is appreciated.
Error Type: System.UnauthorizedAccessException
Error Message: Access to the path "\\FILESERVER101\Budget\BudgetBasics" is denied.
Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode,String str) atSystem.IO.Directory.InternalGetFileDirectoryNames(StringfullPath, Boolean file) atSystem.IO.DirectoryInfo.GetDirectories(String searchPattern) atSystem.IO.DirectoryInfo.GetDirectories()
I have a Virtual Directory called "Bulletins" pointing to a shareon another machine \\FILESERVER101\Budget.
The following is the code in the aspx.vb
Dim impersonationContext AsSystem.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity AsSystem.Security.Principal.WindowsIdentity
currentWindowsIdentity = CType(User.Identity,System.Security.Principal.WindowsIdentity)
impersonationContext =currentWindowsIdentity.Impersonate()
sPath = "Bulletins" & "\Budget Basics\"
'Server.MapPath (check in IIS)
dir = New DirectoryInfo(Server.MapPath(sPath))
'Get the sub directories
dirs = dir.GetDirectories()
dir.GetDirectories()
For Each subDir In dirs
....
....
Any help is appreciated.