Please support our C# advertiser: Programming Forums
Views: 7129 | Replies: 4 | Solved
![]() |
Ok so i want my program to read a text file to a certain point. Lets say to the line line that says fn: i then want it to read the one line only and only the the text after fn: and i want it to shoew that text in a text box. i no it can be done. but i dont know how. if any body knows would you min sharing
-T
-T
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
•
•
Join Date: Dec 2003
Posts: 55
Reputation:
Rep Power: 6
Solved Threads: 6
StreamReader sr = new StreamReader("yourFileNameGoesHere", System.Text.Encoding.Default);
string s = null;
while ((s = sr.ReadLine()) != null)
{
if (s.IndexOf("fn:") != -1)
{
// ok, you found it
// now you can do like
// textBox1.text = s;
break;
}
}
sr.Close(); Thank you so much, man you have helped me learn C# so much. I really thank you for all of your help.
-T
-T
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
•
•
•
•
Originally Posted by tayspen
Thank you so much, man you have helped me learn C# so much. I really thank you for all of your help.
-T
hmmm but how can i make it so it only shos what comes after fn: not inl;uding fn:?
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode