Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello my name is Soumya.I am developing a website in ASP.Net(C#).I have uploaded a text file in APP/Temp folder.Now i want to fetch the first line of the code in a string under a button click event.What will be the method and code?Please help me out.
Posted

1 solution

Such a basic question :

using(System.IO.StreamReader file = 
   new System.IO.StreamReader("filepath"))
{
while((line = file.ReadLine()) != null)
{
   // Read the line
}

file.Close();
}


But I want you to read the basics first .... :rose:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900