473,671 Members | 2,499 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 5526
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*******@disc ussions.microso ft.com> wrote in message
news:0C******** *************** ***********@mic rosoft.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*******@disc ussions.microso ft.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.co m>
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*******@disc ussions.microso ft.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.co m
http://www.pobox.com/~skee
If replying to the group, please do not mail me to

Nov 15 '05 #4
Mike <an*******@disc ussions.microso ft.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.co m>
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
5869
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 class Gedcom {
4
7994
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 open the file in shared mode and read mode. Thanks! Daniel
9
12751
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: "<?xml version="1.0" ?><ERROR>ORA-01403: no data found</ERROR>" HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strURIQuery);
1
1833
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), _ System.Text.Encoding.Unicode)
8
5834
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 only get the file name, not the path. Can someone point out my error? See notes below code. .... Dim strFileNm As String Dim FileNm As New StringBuilder()
3
3111
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) Response.Write(sReader.ReadLine) End While as well as using the FileStream object along with the StreamReader object like this:
4
23033
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 method (ReadFile). I'm going to use this to edit the file paths in all of my WMP play lists. When I run this the string variable is not being changed using the replace method. Here's what I have: Private Sub ReadFile(ByVal path As String)
7
9777
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 static void Main() {
2
6352
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 : $ ../glibc-2.5/configure --prefix=/mnt/new/Mars/glibc_HQ_test/GLIBC/ install/ --with-__thread --enable-kernel=2.6.11 --enable-shared
0
8397
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8919
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8599
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8670
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2813
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2052
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.