473,378 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Can streamreader change a file?

Hello group,

if I open with streamreader a file to read in that way:

StreamReader sr = new StreamReader(c:\\test.txt,
System.Text.Encoding.GetEncoding(10000));

Is it possible that it can change the file in any way? (Change the
encoding of the actual file as example)
Apr 7 '08 #1
1 1643
PS*******@mail.nu wrote:
if I open with streamreader a file to read in that way:

StreamReader sr = new StreamReader(c:\\test.txt,
System.Text.Encoding.GetEncoding(10000));

Is it possible that it can change the file in any way? (Change the
encoding of the actual file as example)
A StreamReader can not change the file itself (you can check the
methods).

If the file is opened in certain ways then other parts of the
app can change the file the StreamReader is reading.

Arne
Apr 8 '08 #2

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

Similar topics

4
by: cody | last post by:
When using a StreamReader I cannot open files that are currently opened from another application and are therefore readonly. But I can open these files in notepad. It seems that StreamReader tries...
11
by: Tiger | last post by:
We can use seek() in the FileStream class,as we know. But I found that seek() is not work correctly in StreamReader. Who can tell me how to use seek() correctly in StreamReader? thanks a lot! I...
1
by: Dan | last post by:
Hi, I'm having a problem with StreamReader.Peek(). Let's say I open a file and read it to end; then I'd want to move its stream pointer back to the file beginning: I can call BaseStream Seek method...
3
by: Mika M | last post by:
Hello! I'm reading text file line by line using the StreamReader like code below shows. Reading is working fine, but if readed line contains Scandinavian letters like äÄöÖ then those letters are...
2
by: Kevin K | last post by:
Hi, I'm having a problem with extracting text from a Word document using StreamReader. As I'm developing a web application, I do NOT want the server to make calls to Word. I want to simply...
9
by: lord.zoltar | last post by:
Hi, I'm having some trouble with a StreamReader. I use a System.IO.StreamReader to read a text file and then print it. If the user has selected a range of pages starting past the first page, I...
4
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...
1
by: Sladan | last post by:
Im trying to read a xml-file with a StreamReader. For the moment I'm using the following code. streamReader = new StreamReader(stream, System.Text.Encoding.Default); string feedData =...
2
by: jehugaleahsa | last post by:
Hello: I am reading a rather oddly formatted file being sent to us by an outside source. I am wondering if there is a way to change what StreamReader sees as a newline. It is searching for a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.