473,513 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

StreamReader Error -he path is too long

I created a StreamReader object from a local file on my c:\ drive

StreamReader srTemp = new StreamReader("C:\\myFile.txt")

I then used a RegEx to strip out all the html and save what's left to a string object
So far so good. So now I'm left with just the text

Question

1.When I created a second streamreader object and pass in the name of this string I got this erro

The path is too long after being fully qualified. Make sure path is less than 260 characters.

2. What path is .net talking about

Thank

Mik
2.
Nov 15 '05 #1
4 5517
Hi,

Can you post the code where you create the second StreamReader?

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mike" <an*******@discussions.microsoft.com> wrote in message
news:0C**********************************@microsof t.com...
I created a StreamReader object from a local file on my c:\ drive.

StreamReader srTemp = new StreamReader("C:\\myFile.txt");

I then used a RegEx to strip out all the html and save what's left to a string object. So far so good. So now I'm left with just the text.

Question:

1.When I created a second streamreader object and pass in the name of this string I got this error
The path is too long after being fully qualified. Make sure path is less than 260 characters."
2. What path is .net talking about?

Thanks

Mike
2.

Nov 15 '05 #2
Mike <an*******@discussions.microsoft.com> wrote:
I created a StreamReader object from a local file on my c:\ drive.

StreamReader srTemp = new StreamReader("C:\\myFile.txt");

I then used a RegEx to strip out all the html and save what's left
to a string object.
So far so good. So now I'm left with just the text.

Question:

1.When I created a second streamreader object and pass in the name of
this string I got this error

The path is too long after being fully qualified. Make sure path is
less than 260 characters."

2. What path is .net talking about?


The path you've given to the StreamReader - which by the sounds of it
is the text that you read from the previous file.

Why are you creating another StreamReader? Are you really after
StringReader, perhaps?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3
Thank you very much John. I didn't know this object existed

Do you know if its faster, slower or about the same speed as a StreamReader

Mik
----- Jon Skeet [C# MVP] wrote: ----

Mike <an*******@discussions.microsoft.com> wrote
I created a StreamReader object from a local file on my c:\ drive
StreamReader srTemp = new StreamReader("C:\\myFile.txt")
I then used a RegEx to strip out all the html and save what's left

to a string object
So far so good. So now I'm left with just the text
Question
1.When I created a second streamreader object and pass in the name o

this string I got this erro
The path is too long after being fully qualified. Make sure path i

less than 260 characters.
2. What path is .net talking about


The path you've given to the StreamReader - which by the sounds of it
is the text that you read from the previous file

Why are you creating another StreamReader? Are you really after
StringReader, perhaps

--
Jon Skeet - <sk***@pobox.com
http://www.pobox.com/~skee
If replying to the group, please do not mail me to

Nov 15 '05 #4
Mike <an*******@discussions.microsoft.com> wrote:
Thank you very much John. I didn't know this object existed!

Do you know if its faster, slower or about the same speed as a StreamReader?


It's entirely different - it reads character just from memory, from a
string, rather than from whatever stream you give it. I can't imagine
many situations where you'd have the option of using one or the other.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5859
by: blah | last post by:
what i want to do is read in a .ged file and find all the names in the file and then add them to a listbox. this is what i have and it works but what can i do better? thanks, Rob public...
4
7989
by: Daniel P. | last post by:
I'm using StreamReader to read a text file and sometimes I get an error saying that the file is opened by someone else. I haven't found any info about how to set a flag to tell StreamReader to...
9
12733
by: oafyuf | last post by:
Hi, I'm having performanbce issues with StreamReader and was wondering what I could do to improve it... The following takes around 3 seconds to process! The content of the response is: ...
1
1824
by: ext237 | last post by:
Hello. I am trying to open a filestream using the following code: Dim myStreamReader As StreamReader = New StreamReader( _ New FileStream("H:\files\file.txt", FileMode.Open), _ ...
8
5828
by: WordVBAProgrammer | last post by:
I've been struggling with this for a few days now. It worked originally as plain VB-type strings, but for some reason ceased creating the FileNm. I changed the code to use StringBuilder, but...
3
3097
by: Arpan | last post by:
A file can be read using only the StreamReader object like this: Dim sReader As StreamReader sReader = New StreamReader(Server.MapPath("File1.txt")) While(sReader.Peek -1)...
4
23020
by: moondaddy | last post by:
I need to edit the text in many files so I'm writing a small routine to do this. First I have a method that loops through all the files in a directory and passes the full file path to another...
7
9766
by: Eran.Yasso | last post by:
Hi, In the MSDN the sample doesn't use the close() method. But I know that in most languages you do need to use the close() method after reading and writing to a file. from MSDN: public...
2
6340
by: akhilesh.noida | last post by:
I am trying to compile glibc-2.5 for ARM based board. But I am getting errors while configuring it. Please check and give your inputs for resolving this. configure command : $...
0
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7158
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7523
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.