|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Server Error in '\' Application
I am trying to get a web page to display all the files in a folder that has contains .pdf files. I then want to take the file names and make them links to the actual file. However I keep getting this error
Server Error in '/' Application. -------------------------------------------------------------------------------- Could not find a part of the path "U:\websites\mlsgateway.com\Forms". Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path "U:\websites\mlsgateway.com\Forms". Source Error: Line 59: Dim di as New DirectoryInfo ("U:\websites\mlsgateway.com\Forms") Line 60: 'Create an array representing the files in the current directory. Line 61: Dim fi As FileInfo() = di.GetFiles("*.pdf") Line 62: 'Print out the names of the files in the current directory. Line 63: Dim fiTemp As FileInfo Here is the complete code Sub GrabFormFiles() 'Create a reference to the current directory. Dim di as New DirectoryInfo("U:\websites\mlsgateway.com\Forms") 'Create an array representing the files in the current directory. Dim fi As FileInfo() = di.GetFiles("*.pdf") 'Print out the names of the files in the current directory. Dim fiTemp As FileInfo Dim vText As String For Each fiTemp In fi vText &= "<a href='" & fiTemp.Name & "'>" & fiTemp.Name & "</a><br>" Next fiTemp PdfFilesLabel.Text = vText End Sub Any help is much appreciated! And thanks in Advanced! |
|
#2
|
|||
|
|||
|
Hi ,
Dim di as New DirectoryInfo ("U:\websites\mlsgateway.com\Forms") changing this line to Dim di as New DirectoryInfo ("U:\\websites\\mlsgateway.com\\Forms") may solve this.............. hope this helps............. Last edited by dineshwarans : March 10th, 2004 at 12:23 AM. |
|
#3
|
|||
|
|||
|
THanks, it did
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > Server Error in '\' Application |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|