Click here to Skip to main content
15,911,141 members
Home / Discussions / C#
   

C#

 
GeneralRe: windows forms TCP connection problem Pin
bar300015-Feb-09 4:37
bar300015-Feb-09 4:37 
GeneralRe: windows forms TCP connection problem Pin
riced15-Feb-09 5:14
riced15-Feb-09 5:14 
GeneralRe: windows forms TCP connection problem Pin
bar300015-Feb-09 22:56
bar300015-Feb-09 22:56 
Questioninstanciate a FileHelperEngine Question Pin
Member 317070314-Feb-09 12:09
Member 317070314-Feb-09 12:09 
AnswerRe: instanciate a FileHelperEngine Question Pin
DaveyM6914-Feb-09 13:04
professionalDaveyM6914-Feb-09 13:04 
General[Message Deleted] Pin
Member 317070314-Feb-09 13:33
Member 317070314-Feb-09 13:33 
GeneralRe: instanciate a FileHelperEngine Question Pin
DaveyM6914-Feb-09 22:18
professionalDaveyM6914-Feb-09 22:18 
QuestionReading A Specific value From Txt File Pin
wwwxyz14-Feb-09 8:53
wwwxyz14-Feb-09 8:53 
my t1.txt is:
1
5
18
125
.
.
.
I want to read a specific value from txt file( sample 3.value that is 18)

using System;<br />
using System.Collections.Generic;<br />
using System.IO;<br />
<br />
class Program<br />
{<br />
    static void Main()<br />
    {<br />
        const string f =(@"C:\t1.txt");<br />
<br />
        // 1<br />
        // Declare new List.<br />
        List<string> lines = new List<string>();<br />
<br />
        // 2<br />
        // Use using StreamReader for disposing.<br />
        using (StreamReader r = new StreamReader(f))<br />
        {<br />
            // 3<br />
            // Use while != null pattern for loop<br />
            string line;<br />
            while ((line = r.ReadLine()) != null)<br />
            {<br />
                // 4<br />
                // Insert logic here.<br />
                // ...<br />
                // "line" is a line in the file. Add it to our List.<br />
                lines.Add(line);<br />
            }<br />
        }<br />
<br />
        // 5<br />
        // Print out all the lines.<br />
        foreach (string s in lines)<br />
        { <br />
            Console.WriteLine(s);<br />
        }<br />
     <br />
    }<br />
}</string></string>

AnswerRe: Reading A Specific value From Txt File Pin
Wendelius14-Feb-09 9:11
mentorWendelius14-Feb-09 9:11 
AnswerRe: Reading A Specific value From Txt File Pin
Calin Tatar14-Feb-09 9:14
Calin Tatar14-Feb-09 9:14 
AnswerRe: Reading A Specific value From Txt File Pin
Nuri Ismail14-Feb-09 9:18
Nuri Ismail14-Feb-09 9:18 
GeneralRe: Reading A Specific value From Txt File Pin
wwwxyz14-Feb-09 9:28
wwwxyz14-Feb-09 9:28 
GeneralRe: Reading A Specific value From Txt File Pin
Deresen14-Feb-09 11:01
Deresen14-Feb-09 11:01 
AnswerRe: Reading A Specific value From Txt File Pin
wwwxyz14-Feb-09 11:18
wwwxyz14-Feb-09 11:18 
GeneralRe: Reading A Specific value From Txt File Pin
Deresen14-Feb-09 11:30
Deresen14-Feb-09 11:30 
GeneralRe: Reading A Specific value From Txt File Pin
wwwxyz14-Feb-09 11:53
wwwxyz14-Feb-09 11:53 
Questionimagemap with highlight Pin
Axell14-Feb-09 8:19
Axell14-Feb-09 8:19 
AnswerRe: imagemap with highlight Pin
Nuri Ismail14-Feb-09 8:27
Nuri Ismail14-Feb-09 8:27 
GeneralRe: imagemap with highlight Pin
DaveyM6914-Feb-09 8:29
professionalDaveyM6914-Feb-09 8:29 
GeneralRe: imagemap with highlight Pin
Axell14-Feb-09 8:34
Axell14-Feb-09 8:34 
GeneralRe: imagemap with highlight Pin
DaveyM6914-Feb-09 11:29
professionalDaveyM6914-Feb-09 11:29 
AnswerRe: imagemap with highlight Pin
DaveyM6914-Feb-09 8:28
professionalDaveyM6914-Feb-09 8:28 
Questionarray table or string table Pin
abbd14-Feb-09 7:38
abbd14-Feb-09 7:38 
AnswerRe: array table or string table Pin
Nuri Ismail14-Feb-09 8:04
Nuri Ismail14-Feb-09 8:04 
GeneralRe: array table or string table Pin
abbd14-Feb-09 8:39
abbd14-Feb-09 8:39 

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.