Click here to Skip to main content
15,905,028 members
Home / Discussions / C#
   

C#

 
AnswerRe: control Pin
Sandeep Akhare3-Jul-07 0:08
Sandeep Akhare3-Jul-07 0:08 
QuestionGif conversion Pin
MostafaSayed2-Jul-07 23:00
MostafaSayed2-Jul-07 23:00 
AnswerRe: Gif conversion Pin
remex_1980_junyongwu2-Jul-07 23:49
remex_1980_junyongwu2-Jul-07 23:49 
Questionformat string. Pin
hkchauhan2-Jul-07 22:55
hkchauhan2-Jul-07 22:55 
AnswerRe: format string. Pin
Giorgi Dalakishvili2-Jul-07 23:06
mentorGiorgi Dalakishvili2-Jul-07 23:06 
AnswerRe: format string. Pin
Steve Hansen2-Jul-07 23:22
Steve Hansen2-Jul-07 23:22 
GeneralRe: format string. Pin
hkchauhan2-Jul-07 23:25
hkchauhan2-Jul-07 23:25 
GeneralRe: format string. Pin
Steve Hansen2-Jul-07 23:33
Steve Hansen2-Jul-07 23:33 
Eew, you do know we are already at .NET 3.0 and 3.5 is comming in a few months.
Oh well you should so something like:
StringBuilder sb = new StringBuilder(); // From System.Text namespace
using (StreamReader re = File.OpenText("abc.txt")) // Using makes sure the reader gets disposed correctly
{
  string input = null;
  while ((input = re.ReadLine()) != null)
  {
    sb.AppendLine(input); // StringBuilder has easy method to add new line and is alot faster than string concat
  }
}
string result = sb.ToString();


Oh StreamReader has a ReadToEnd() which does what I did here :P

string result = null;
using (StreamReader re = File.OpenText("abc.txt")) // Using makes sure the reader gets disposed correctly
{
  result = re.ReadToEnd();
}

GeneralRe: format string. Pin
hkchauhan2-Jul-07 23:45
hkchauhan2-Jul-07 23:45 
AnswerRe: format string. Pin
Tamimi - Code2-Jul-07 23:34
Tamimi - Code2-Jul-07 23:34 
QuestionDisable show pop-up window when F10 pressed Pin
Tavbi2-Jul-07 22:50
Tavbi2-Jul-07 22:50 
AnswerRe: Disable show pop-up window when F10 pressed Pin
Tavbi2-Jul-07 22:54
Tavbi2-Jul-07 22:54 
AnswerRe: Disable show pop-up window when F10 pressed Pin
Dave Kreskowiak3-Jul-07 6:34
mveDave Kreskowiak3-Jul-07 6:34 
GeneralRe: Disable show pop-up window when F10 pressed Pin
Tavbi3-Jul-07 19:31
Tavbi3-Jul-07 19:31 
GeneralRe: Disable show pop-up window when F10 pressed Pin
Tavbi3-Jul-07 19:46
Tavbi3-Jul-07 19:46 
AnswerRe: Disable show pop-up window when F10 pressed Pin
Tavbi3-Jul-07 21:25
Tavbi3-Jul-07 21:25 
QuestionIntegral of a function Pin
Manfr3d2-Jul-07 22:47
Manfr3d2-Jul-07 22:47 
AnswerRe: Integral of a function Pin
Martin#3-Jul-07 0:25
Martin#3-Jul-07 0:25 
QuestionDataGridview Pin
sangramkp2-Jul-07 22:15
sangramkp2-Jul-07 22:15 
QuestionHow can I protect my exe? Pin
Rationalise2-Jul-07 22:08
Rationalise2-Jul-07 22:08 
QuestionHow to use the FormPrinting with a vertical Alignment? Pin
loriasilvia2-Jul-07 21:48
loriasilvia2-Jul-07 21:48 
Questioncontrols Pin
kalyan_24162-Jul-07 21:39
kalyan_24162-Jul-07 21:39 
AnswerRe: controls Pin
Tamimi - Code2-Jul-07 21:45
Tamimi - Code2-Jul-07 21:45 
GeneralRe: controls Pin
kalyan_24162-Jul-07 21:52
kalyan_24162-Jul-07 21:52 
GeneralRe: controls Pin
kalyan_24162-Jul-07 23:10
kalyan_24162-Jul-07 23:10 

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.