471,863 Members | 894 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,863 software developers and data experts.

Noob question: "Could not find a part of the path"


I am new to ASP.NET and am working on an application that runs on a
webserver. The user will open up the web interface in a browser on
their local machine and enter a path to a directory. I have 2

First, I can't find a control that will let the user browse the file
system and specify a directory - the
only one I can find is the one that lets the user specify a file.

Secondly, when the remote user submits the path I get the error "Could
not find part of the path...". I think the application is looking on
the server itself for the path cause if I create a path on the server
that is the same as the one specified, then it is happy. How do I
tell ASP that I want it to look for the path on the remote machine?

I am using VB to write the code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button1.Click
If Request.Form("DirectoryName").Length = 0
ASPNET_MsgBox("Please indicate which directory
your mail is situated in")
Exit Sub
End If

Dim counter As Integer
counter = 0

' Read in the files from the directory specified in the
directory name text field
Dim currentDirectory As DirectoryInfo = New
Dim fileArray As FileInfo() =
Dim file As FileInfo

' Add the files to the list
For Each file In fileArray
If file.Extension.Equals(".mmi")
counter += 1
End If
Catch exception As UnauthorizedAccessException
ASPNET_MsgBox("Warning: Some files may not be
visible due to permission settings")
End Try

If (counter = 0) Then
ASPNET_MsgBox("The directory you chose contained
no mail items")
End If
End Sub

Posted Via Usenet.com Premium Usenet Newsgroup Services
Nov 18 '05 #1
0 1519

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by dsh | last post: by
9 posts views Thread by Clinton Frankland | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.