Re: Access network shares with filesystemobject



Doing gives the same results - I cannot access network shares with UNC
either (although this also works fine in class asp)

"Clamps" <Clamps@xxxxxxxxxxxx> wrote in message
news:e0N$TszrFHA.2220@xxxxxxxxxxxxxxxxxxxxxxx
> You could use the UNC instead.
> io.file.exists(\\server\sharedfolder) instead of mapped drive letter.
>
> "Josh Rolfe" <someone@xxxxxxxxxxxxx> wrote in message
> news:%231ftMOzrFHA.2212@xxxxxxxxxxxxxxxxxxxxxxx
>> I have a page in classic asp that accces a network drive, The code is as
>> follows:
>> <%
>> dim fso
>> dim objFolder
>> set fso=server.createObject("Scripting.FileSystemObject")
>> set objFolder=fso.GetFolder("f:\")
>> for each objFile in objFolder.files
>> response.write objFile.name & "<br>"
>> next
>> %>
>>
>> (f: is a network drive)
>> I am trying to do the same thing in asp.net. My code behind is as
> follows:
>>
>> Public Class WebForm1
>> Inherits System.Web.UI.Page
>>
>> #Region " Web Form Designer Generated Code "
>>
>> ...
>>
>> #End Region
>>
>> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles MyBase.Load
>> Dim fso, objFolder, objFile As Object
>> Dim strFolder As String
>> fso = Server.CreateObject("Scripting.FileSystemObject")
>> strFolder = "f:\"
>> objFolder = fso.getFolder(strFolder)
>> For Each objFile In objFolder.files
>> Response.Write(objFile.name & "<br>")
>> Next
>> End Sub
>> End Class
>>
>> Both pages run as integrated authentication with no anonymous access
>> allowed. it works fine in classic asp, but not in asp.net. It works in
>> asp.net if I access a local folder like c:\. The error I get in asp.net
> is:
>>
>> Exception from HRESULT: 0x800A004C (CTL_E_PATHNOTFOUND).
>> Description: An unhandled exception occurred during the execution of the
>> current web request. Please review the stack trace for more information
>> about the error and where it originated in the code.
>>
>> Exception Details: System.IO.DirectoryNotFoundException: Exception from
>> HRESULT: 0x800A004C (CTL_E_PATHNOTFOUND).
>>
>>
>
>


.



Relevant Pages

  • Re: Wanted: Word Hyperlinks to Mapped Drive, NOT to UNC
    ... >>display the field codes the hyperlink will reflect the mapped drive. ... > when the link is clicked will still go to the UNC path. ... hyperlinks to drive letters on network resources ... > drive letter; however, I found that clicking the link will go to the ...
    (microsoft.public.word.application.errors)
  • Re: VB.Net file access problem with UNC
    ... The error is very likely caused by the network driver. ... > The only problem is when the system is disconnected under UNC. ... >>> Reference DOS Server using UNC, DOS Server on-line: ...
    (microsoft.public.dotnet.languages.vb)
  • RE: No results from ASP page
    ... The user that you specify as the connect as user for the shared folder is ... Microsoft Application Center & Index Server Support ... | I have set up indexing services and an asp search page.. ... | run queries on network directories from within IIS - Query ...
    (microsoft.public.inetserver.indexserver)
  • Re: UnauthorizedAccessException
    ... I tried using the UNC in the path without success. ... suggestion about turning auditing. ... >> occurring where a folder on a network share is denying access to the ... FileIOPermission is a Code Access permission. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: No results from ASP page
    ... catalogue is okay and I can search fine on form in IIS.. ... No results from ASP page ... >| run queries on network directories from within IIS - ...
    (microsoft.public.inetserver.indexserver)