Click here to Skip to main content
15,910,886 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Text Files Pin
muka6612-Feb-10 2:44
muka6612-Feb-10 2:44 
GeneralRe: Text Files Pin
harold aptroot12-Feb-10 2:07
harold aptroot12-Feb-10 2:07 
GeneralRe: Text Files Pin
daveyerwin12-Feb-10 2:22
daveyerwin12-Feb-10 2:22 
GeneralRe: Text Files Pin
muka6612-Feb-10 2:46
muka6612-Feb-10 2:46 
GeneralRe: Text Files Pin
OriginalGriff12-Feb-10 4:58
mveOriginalGriff12-Feb-10 4:58 
GeneralRe: Text Files Pin
muka6614-Feb-10 22:42
muka6614-Feb-10 22:42 
QuestionLoooping through DataSet with threads but locking Pin
Danpeking11-Feb-10 22:39
Danpeking11-Feb-10 22:39 
AnswerRe: Loooping through DataSet with threads but locking Pin
OriginalGriff11-Feb-10 22:43
mveOriginalGriff11-Feb-10 22:43 
GeneralRe: Loooping through DataSet with threads but locking Pin
Danpeking11-Feb-10 23:38
Danpeking11-Feb-10 23:38 
GeneralRe: Loooping through DataSet with threads but locking Pin
OriginalGriff11-Feb-10 23:42
mveOriginalGriff11-Feb-10 23:42 
GeneralRe: Loooping through DataSet with threads but locking Pin
Danpeking12-Feb-10 5:04
Danpeking12-Feb-10 5:04 
QuestionHow i can refresh CD/DVD Drive ? Pin
Nematjon Rahmanov11-Feb-10 22:30
Nematjon Rahmanov11-Feb-10 22:30 
AnswerRe: How i can refresh CD/DVD Drive ? Pin
Abhinav S11-Feb-10 22:49
Abhinav S11-Feb-10 22:49 
GeneralRe: How i can refresh CD/DVD Drive ? Pin
Nematjon Rahmanov12-Feb-10 0:08
Nematjon Rahmanov12-Feb-10 0:08 
QuestionWhat invoked the getformattedvalue function in datagridviewtextboxcell? Pin
HideIvy11-Feb-10 21:30
HideIvy11-Feb-10 21:30 
AnswerRe: What invoked the getformattedvalue function in datagridviewtextboxcell? Pin
HideIvy11-Feb-10 22:44
HideIvy11-Feb-10 22:44 
Questiondisplay MailMessage Pin
paschka7611-Feb-10 21:02
paschka7611-Feb-10 21:02 
AnswerRe: display MailMessage Pin
AspDotNetDev11-Feb-10 21:51
protectorAspDotNetDev11-Feb-10 21:51 
AnswerRe: display MailMessage Pin
i gr811-Feb-10 22:48
i gr811-Feb-10 22:48 
QuestionI know how to clear textboxs on my form at one time but what if they are bound? Pin
tonyonlinux11-Feb-10 20:28
tonyonlinux11-Feb-10 20:28 
AnswerRe: I know how to clear textboxs on my form at one time but what if they are bound? Pin
AspDotNetDev11-Feb-10 21:13
protectorAspDotNetDev11-Feb-10 21:13 

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.