Click here to Skip to main content
15,909,498 members
Home / Discussions / C#
   

C#

 
GeneralRe: Garbage collection problem Pin
S. Senthil Kumar26-Jan-07 5:36
S. Senthil Kumar26-Jan-07 5:36 
GeneralRe: Garbage collection problem Pin
Colin Angus Mackay26-Jan-07 5:45
Colin Angus Mackay26-Jan-07 5:45 
GeneralRe: Garbage collection problem Pin
Guffa26-Jan-07 6:18
Guffa26-Jan-07 6:18 
GeneralRe: Garbage collection problem Pin
S. Senthil Kumar26-Jan-07 6:45
S. Senthil Kumar26-Jan-07 6:45 
AnswerRe: Garbage collection problem Pin
Judah Gabriel Himango26-Jan-07 5:56
sponsorJudah Gabriel Himango26-Jan-07 5:56 
AnswerRe: Garbage collection problem Pin
Dave Kreskowiak26-Jan-07 6:06
mveDave Kreskowiak26-Jan-07 6:06 
AnswerRe: Garbage collection problem Pin
t4ure4n29-Jan-07 0:13
t4ure4n29-Jan-07 0:13 
QuestionText file handling issue Pin
Andrew Em26-Jan-07 3:21
Andrew Em26-Jan-07 3:21 
Hi I got a problem with the project i'm building, i'm using StreamWriter and to append text to a textfile, so the text file look like this:

entry1
entry2
entry3
*blank row*
entry4
entry5
entry6
*blank row*

i do that with this code:

StreamWriter sw = File.AppendText("test.txt");<br />
sw.WriteLine(tb1.Text);<br />
sw.WriteLine(tb2.Text + " : " + tb21.Text);<br />
sw.WriteLine(tb3.Text);<br />
sw.WriteLine();<br />
sw.Flush();<br />
sw.Close();


Then i use a loop and array to read those files into my application.

TextReader TR = new StreamReader("test.txt");<br />
         int NumberOfLines = 20;<br />
         string[] ListLines = new string[NumberOfLines];<br />
         for (int i = 1; i < NumberOfLines; i++)<br />
         {<br />
             ListLines[i] = TR.ReadLine();<br />
         }



Now i got the problem, i need to be able to delete/change the "packs" between the blank line, was thinking something like making a backup of the file and re-writing it, without the selected pack (using a listbox to select) or in some way replace that pack with what the user types in instead when i hit the delete or change button. The problem is i dont know how to get the "new" text to the same position as the old when i change it. Anyone got an idea?

Sorry if i confuse you Smile | :)

--


Light is faster than sound... Thats why some people look smart till they start to talk.

AnswerRe: Text file handling issue Pin
Colin Angus Mackay26-Jan-07 3:52
Colin Angus Mackay26-Jan-07 3:52 
AnswerRe: Text file handling issue Pin
bobsugar22226-Jan-07 4:20
bobsugar22226-Jan-07 4:20 
GeneralAbout the pre tag Pin
Guffa26-Jan-07 8:31
Guffa26-Jan-07 8:31 
GeneralRe: About the pre tag Pin
bobsugar22226-Jan-07 8:59
bobsugar22226-Jan-07 8:59 
GeneralRe: Text file handling issue Pin
Andrew Em28-Jan-07 20:24
Andrew Em28-Jan-07 20:24 
Questionexcel in C# Pin
barak16048726-Jan-07 3:02
barak16048726-Jan-07 3:02 
AnswerRe: excel in C# Pin
Dustin Metzgar26-Jan-07 4:50
Dustin Metzgar26-Jan-07 4:50 
QuestionNeed help in creating an XML file from a Dataset using a schema file Pin
csharpguyfromde26-Jan-07 2:31
csharpguyfromde26-Jan-07 2:31 
AnswerRe: Need help in creating an XML file from a Dataset using a schema file Pin
bobsugar22226-Jan-07 3:12
bobsugar22226-Jan-07 3:12 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
csharpguyfromde26-Jan-07 3:16
csharpguyfromde26-Jan-07 3:16 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file [modified] Pin
bobsugar22226-Jan-07 3:41
bobsugar22226-Jan-07 3:41 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
Abisodun26-Jan-07 4:42
Abisodun26-Jan-07 4:42 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
csharpguyfromde26-Jan-07 5:35
csharpguyfromde26-Jan-07 5:35 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
Abisodun26-Jan-07 8:13
Abisodun26-Jan-07 8:13 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
csharpguyfromde26-Jan-07 8:37
csharpguyfromde26-Jan-07 8:37 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
Abisodun26-Jan-07 9:12
Abisodun26-Jan-07 9:12 
GeneralRe: Need help in creating an XML file from a Dataset using a schema file Pin
bobsugar22226-Jan-07 8:32
bobsugar22226-Jan-07 8:32 

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.