C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 05-30-2006, 11:08 PM   #1
Registered User
 
Join Date: Feb 2006
Posts: 44
Exclamation Path Questions StreamReader??

Hello,

I'm reading a file from a network drive but I'm having a problem in this line.
Code:
StreamReader fileRead = new StreamReader("\\E-Storage\\Billing\\text.txt")
The reason that I don't specify the drive is because I will be reading a file from a network drive which sometimes could be map to different drive letters.

My question is how should I write the path then

Code:
("\\E-Storage\\Billing\\text.txt") or
(@"\E-Storage\Billing\text.txt")
I tried both and program did not work however when I specified a letter such as c:\text.txt it works fine so could you correct me if I'm wrong.

Thank you
Dilmerv is offline   Reply With Quote
Old 05-30-2006, 11:55 PM   #2
Registered User
 
Join Date: May 2006
Posts: 894
I'm far from being sure about this, but I think you might try it though:

"%root%\\E-Storage\\Billing\\text.txt"

I think I've seen this somewhere = /
Desolation is offline   Reply With Quote
Old 05-31-2006, 06:59 AM   #3
Anti-Poster
 
Join Date: Feb 2002
Posts: 1,241
This worked for me:
Code:
(@"\\Bdonaldsondev\documentation\bgd3.txt") or
("\\\\Bdonaldsondev\\documentation\\bgd3.txt")
Remember that you need two slashes on the beginning for network paths, not one.
__________________
Rule #1: Every rule has exceptions
pianorain is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shortest Path Maze Solver (Breadth Search Help) Raskalnikov C Programming 5 04-07-2009 07:41 PM
Can't figure out what keeps hanging up my program shays C Programming 7 11-12-2007 02:59 PM
A very long list of questions... maybe to long... Ravens'sWrath C Programming 16 05-16-2007 05:36 AM
Path Choice Questions Dae Game Programming 8 07-02-2005 05:34 AM
linked list recursive function spaghetti ... C++ Programming 4 09-02-2003 02:53 PM


All times are GMT -6. The time now is 12:42 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22