Click here to Skip to main content
16,004,227 members
Home / Discussions / C#
   

C#

 
AnswerRe: Windows Forms Pin
Christian Graus27-Mar-07 3:35
protectorChristian Graus27-Mar-07 3:35 
GeneralRe: Windows Forms Pin
Martin#27-Mar-07 3:40
Martin#27-Mar-07 3:40 
AnswerRe: Windows Forms Pin
Martin#27-Mar-07 3:36
Martin#27-Mar-07 3:36 
QuestionLarge TXT files Pin
Sabry190527-Mar-07 3:04
Sabry190527-Mar-07 3:04 
AnswerRe: Large TXT files Pin
Christian Graus27-Mar-07 3:13
protectorChristian Graus27-Mar-07 3:13 
AnswerRe: Large TXT files Pin
hakonvik27-Mar-07 3:22
hakonvik27-Mar-07 3:22 
GeneralRe: Large TXT files Pin
Christian Graus27-Mar-07 3:36
protectorChristian Graus27-Mar-07 3:36 
GeneralRe: Large TXT files Pin
Sabry190527-Mar-07 5:12
Sabry190527-Mar-07 5:12 
that is my code , and i had run it for a txt file its size is 423 MB, and i left my PC opened and in the mext day i found that it records about 10 hours and large number of lines about 500000 line and also i got an exception "OutOfMemoryException"
and i dont know much about "backgroundworker", if you know a complete example plz provid me by the link

StreamReader SR;
private void btnReadFile_Click(object sender, EventArgs e)
{
DateTime DT= DateTime.Now;
TimeSpan T = new TimeSpan(DT.Day, DT.Hour, DT.Minute, DT.Second);
if (SR != null)
{
while (!SR.EndOfStream)
{
try
{
string line = SR.ReadLine();
txtFileContent.AppendText(line);
txtFileContent.AppendText("\n");
txtFileContent.AppendText("\r");
int count = Convert.ToInt32(labNumOfLines.Text);
count++;
labNumOfLines.Text = count.ToString();
DateTime tempTime = DateTime.Now;
TimeSpan T2 = new TimeSpan(tempTime.Day, tempTime.Hour, tempTime.Minute, tempTime.Second);
T2=T2.Subtract(T);
labTime.Text = T2.ToString();
this.Refresh();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

}
}
}
GeneralRe: Large TXT files Pin
Dan Neely27-Mar-07 5:24
Dan Neely27-Mar-07 5:24 
GeneralRe: Large TXT files Pin
Sabry190527-Mar-07 5:51
Sabry190527-Mar-07 5:51 
GeneralRe: Large TXT files Pin
Dan Neely27-Mar-07 6:52
Dan Neely27-Mar-07 6:52 
AnswerUse a FileStream Pin
Ennis Ray Lynch, Jr.27-Mar-07 5:14
Ennis Ray Lynch, Jr.27-Mar-07 5:14 
QuestionMotorola S-Record file to Binary file Pin
-=gix=-27-Mar-07 2:02
-=gix=-27-Mar-07 2:02 
AnswerRe: Motorola S-Record file to Binary file Pin
Colin Angus Mackay27-Mar-07 2:25
Colin Angus Mackay27-Mar-07 2:25 
GeneralRe: Motorola S-Record file to Binary file Pin
-=gix=-27-Mar-07 3:10
-=gix=-27-Mar-07 3:10 
GeneralRe: Motorola S-Record file to Binary file Pin
Colin Angus Mackay27-Mar-07 12:35
Colin Angus Mackay27-Mar-07 12:35 
GeneralRe: Motorola S-Record file to Binary file Pin
-=gix=-29-Mar-07 20:11
-=gix=-29-Mar-07 20:11 
QuestionSharing a folder with users programmatically Pin
wasife27-Mar-07 1:23
wasife27-Mar-07 1:23 
QuestionConsole the text that user keyin in text box to another window form . Pin
krajah1027-Mar-07 0:06
krajah1027-Mar-07 0:06 
AnswerRe: Console the text that user keyin in text box to another window form . Pin
Colin Angus Mackay27-Mar-07 0:37
Colin Angus Mackay27-Mar-07 0:37 
QuestionRead password from text file and compare with user textbox input Pin
krajah1026-Mar-07 23:56
krajah1026-Mar-07 23:56 
AnswerRe: Read password from text file and compare with user textbox input Pin
Balaji Prabu AL27-Mar-07 1:06
Balaji Prabu AL27-Mar-07 1:06 
GeneralRe: Read password from text file and compare with user textbox input Pin
krajah1027-Mar-07 4:34
krajah1027-Mar-07 4:34 
QuestionRe: Read password from text file and compare with user textbox input Pin
Balaji Prabu AL27-Mar-07 6:44
Balaji Prabu AL27-Mar-07 6:44 
AnswerRe: Read password from text file and compare with user textbox input Pin
krajah1027-Mar-07 21:59
krajah1027-Mar-07 21:59 

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.