Click here to Skip to main content
15,898,988 members
Home / Discussions / C#
   

C#

 
AnswerRe: Documentation description about the method and its parameters. Pin
R. Giskard Reventlov12-Feb-10 3:33
R. Giskard Reventlov12-Feb-10 3:33 
AnswerRe: Documentation description about the method and its parameters. Pin
dan!sh 12-Feb-10 3:36
professional dan!sh 12-Feb-10 3:36 
GeneralRe: Documentation description about the method and its parameters. Pin
Blubbo12-Feb-10 3:46
Blubbo12-Feb-10 3:46 
QuestionMultiPage-Application - Navigation Pin
PingOfDeath198312-Feb-10 3:09
PingOfDeath198312-Feb-10 3:09 
AnswerRe: MultiPage-Application - Navigation Pin
dan!sh 12-Feb-10 3:11
professional dan!sh 12-Feb-10 3:11 
QuestionAT command problem Pin
saeidfarahi12-Feb-10 2:44
saeidfarahi12-Feb-10 2:44 
AnswerRe: AT command problem Pin
Richard MacCutchan12-Feb-10 3:24
mveRichard MacCutchan12-Feb-10 3:24 
GeneralRe: AT command problem Pin
saeidfarahi12-Feb-10 3:28
saeidfarahi12-Feb-10 3:28 
GeneralRe: AT command problem Pin
Richard MacCutchan12-Feb-10 3:49
mveRichard MacCutchan12-Feb-10 3:49 
QuestionThread sychronization Pin
koleraba12-Feb-10 2:35
koleraba12-Feb-10 2:35 
AnswerRe: Hi Pin
Not Active12-Feb-10 4:07
mentorNot Active12-Feb-10 4:07 
GeneralRe: Hi Pin
koleraba12-Feb-10 5:31
koleraba12-Feb-10 5:31 
QuestionAppDomain Pin
Le centriste12-Feb-10 2:10
Le centriste12-Feb-10 2:10 
AnswerRe: AppDomain Pin
dan!sh 12-Feb-10 3:25
professional dan!sh 12-Feb-10 3:25 
GeneralRe: AppDomain Pin
Le centriste12-Feb-10 3:32
Le centriste12-Feb-10 3:32 
AnswerRe: AppDomain Pin
kevinnicol12-Feb-10 5:26
kevinnicol12-Feb-10 5:26 
QuestionTree view drawing problem Pin
gwithey11-Feb-10 23:32
gwithey11-Feb-10 23:32 
QuestionText Files Pin
muka6611-Feb-10 23:30
muka6611-Feb-10 23:30 
JokeRe: Text Files Pin
Richard MacCutchan11-Feb-10 23:31
mveRichard MacCutchan11-Feb-10 23:31 
GeneralRe: Text Files Pin
muka6611-Feb-10 23:33
muka6611-Feb-10 23:33 
GeneralRe: Text Files Pin
Richard MacCutchan12-Feb-10 0:11
mveRichard MacCutchan12-Feb-10 0:11 
AnswerRe: Text Files Pin
Anurag Gandhi11-Feb-10 23:49
professionalAnurag Gandhi11-Feb-10 23:49 
AnswerRe: Text Files Pin
OriginalGriff11-Feb-10 23:50
mveOriginalGriff11-Feb-10 23:50 
GeneralRe: Text Files Pin
muka6612-Feb-10 1:56
muka6612-Feb-10 1:56 
when i read the whole file, i manage to sisplay the content on a label, now I need to display only the first five line of the text file, but currently the program just display one line.


public partial class _Default : System.Web.UI.Page
{

protected void Page_Load(object sender, EventArgs e)
{

try
{
StreamReader objStream;

string myfile = Request.QueryString["txtreader"] + ".txt";

string reading = Server.MapPath(myfile);

string[] lines = new string[5];

using (objStream = new StreamReader(reading))

for (int i = 0; i < 5; i++)
{
if (!objStream.EndOfStream)
{
lines[i] = objStream.ReadLine();
lblDispaly.Text = lines[i];
}

}
objStream.Close();

}
catch(FileNotFoundException exc)
{
lblerror.Text = exc.ToString();
}
}

Thanx
GeneralRe: Text Files Pin
ddecoy12-Feb-10 2:05
ddecoy12-Feb-10 2:05 

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.