Click here to Skip to main content
15,902,276 members
Home / Discussions / C#
   

C#

 
QuestionDataset table row edit mode Pin
dingo146-Apr-09 5:31
dingo146-Apr-09 5:31 
AnswerRe: Dataset table row edit mode Pin
Mycroft Holmes6-Apr-09 12:29
professionalMycroft Holmes6-Apr-09 12:29 
QuestionHelp For .Net ComponentClass help Pin
crrajaguru6-Apr-09 4:20
crrajaguru6-Apr-09 4:20 
AnswerRe: Help For .Net ComponentClass help Pin
Jack Li6-Apr-09 4:32
Jack Li6-Apr-09 4:32 
AnswerRe: Help For .Net ComponentClass help Pin
Henry Minute6-Apr-09 6:29
Henry Minute6-Apr-09 6:29 
QuestionReadLine, Perform Action, DeleteLine, ReadNextLine... Pin
jas0n236-Apr-09 3:54
jas0n236-Apr-09 3:54 
AnswerRe: ReadLine, Perform Action, DeleteLine, ReadNextLine... Pin
Mirko19806-Apr-09 4:11
Mirko19806-Apr-09 4:11 
AnswerRe: ReadLine, Perform Action, DeleteLine, ReadNextLine... Pin
Deresen6-Apr-09 4:12
Deresen6-Apr-09 4:12 
To do this, you have to do something like this:

while(true)
{
  StringBuilder wholeText = "";
  String fileName = "file.txt";
  // create reader & open file
  Textreader tr = new StreamReader(fileName);

  // read a line of text
  String oneLine = tr.ReadLine();
  if(oneLine == null)
  {
     break;
  }
  else
  {
     doSomethingWith(oneLine);
  }

  while(String s = tr.ReadLine != null)
  {
     wholeText.add(String.Format("{0}\n",s);
  } 
  // close the stream
  tr.Close();

  //open the same file and write the text in there
  Textwriter tw = new StreamWriter(fileName);
  tw.write(wholeText.ToString());
  tw.Close();
}


This isn't tested, but the methodoligy should work.
AnswerRe: ReadLine, Perform Action, DeleteLine, ReadNextLine... Pin
Luc Pattyn6-Apr-09 4:31
sitebuilderLuc Pattyn6-Apr-09 4:31 
AnswerRe: ReadLine, Perform Action, DeleteLine, ReadNextLine... Pin
jas0n236-Apr-09 5:25
jas0n236-Apr-09 5:25 
GeneralRe: ReadLine, Perform Action, DeleteLine, ReadNextLine... Pin
Luc Pattyn6-Apr-09 6:10
sitebuilderLuc Pattyn6-Apr-09 6:10 
GeneralRe: ReadLine, Perform Action, DeleteLine, ReadNextLine... Pin
jas0n2311-Apr-09 20:59
jas0n2311-Apr-09 20:59 
QuestionProblem with PropertyGrid Pin
sandeepkavade6-Apr-09 2:33
sandeepkavade6-Apr-09 2:33 
QuestionRemoting using WEBDAV Protocol Pin
balu123456-Apr-09 2:00
balu123456-Apr-09 2:00 
AnswerRe: Remoting using WEBDAV Protocol Pin
SeMartens6-Apr-09 2:29
SeMartens6-Apr-09 2:29 
Questiondisplay the items in a combobox Pin
ShivarajKumar6-Apr-09 1:44
ShivarajKumar6-Apr-09 1:44 
AnswerRe: display the items in a combobox Pin
akhilonly0076-Apr-09 1:58
akhilonly0076-Apr-09 1:58 
AnswerRe: display the items in a combobox Pin
Giorgi Dalakishvili6-Apr-09 2:05
mentorGiorgi Dalakishvili6-Apr-09 2:05 
QuestionHow to insert text to GIF and animate the text ? Pin
ErezRozn6-Apr-09 1:41
ErezRozn6-Apr-09 1:41 
AnswerRe: How to insert text to GIF and animate the text ? Pin
Luc Pattyn6-Apr-09 2:41
sitebuilderLuc Pattyn6-Apr-09 2:41 
QuestionHow do i compress a large dataset Pin
Danie de Kock6-Apr-09 1:37
Danie de Kock6-Apr-09 1:37 
AnswerRe: How do i compress a large dataset Pin
SeMartens6-Apr-09 2:36
SeMartens6-Apr-09 2:36 
GeneralRe: How do i compress a large dataset Pin
Danie de Kock6-Apr-09 3:06
Danie de Kock6-Apr-09 3:06 
GeneralRe: How do i compress a large dataset Pin
SeMartens6-Apr-09 3:27
SeMartens6-Apr-09 3:27 
QuestionHow to catch browser close Pin
dataminers6-Apr-09 1:03
dataminers6-Apr-09 1:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.