.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 8th, 2004, 10:53 AM
jmlsgateway jmlsgateway is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: OKC
Posts: 342 jmlsgateway User rank is Private First Class (20 - 50 Reputation Level)jmlsgateway User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 20 h 48 m 28 sec
Reputation Power: 5
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!

Reply With Quote
  #2  
Old March 10th, 2004, 12:20 AM
dineshwarans dineshwarans is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 4 dineshwarans User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old March 10th, 2004, 10:32 AM
jmlsgateway jmlsgateway is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: OKC
Posts: 342 jmlsgateway User rank is Private First Class (20 - 50 Reputation Level)jmlsgateway User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 20 h 48 m 28 sec
Reputation Power: 5
THanks, it did

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Server Error in '\' Application


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT