TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Carlos Martinez
NA
12
11.2k
I need help debugging my error
Jul 29 2010 2:14 PM
hi guys ! newbie here
I need help debugging my error.
currently using .Net 4.0 VS2010
Here is an screen shot of the error
http://img841.imageshack.us/img841/6832/pic1p.jpg
// Runner class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ListOfRunners
{
class Runner
{
public string Name { get; set; }
public int Time { get; set; }
public int Age { get; set; }
}
}
// Main Program
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ListOfRunners
{
class Program
{
static void Main(string[] args)
{
Runner runner = new Runner();
List<Runner> listRunner = new List<Runner>();
StreamReader myReader = new StreamReader("TextFile1.txt");
string line = "";
do
{
line = myReader.ReadLine();
if (line != null)
{
listRunner.Add(GetRunnerDetails(line));
}
} while (line!= null);
myReader.Close();
Console.ReadLine();
}
public static Runner GetRunnerDetails(string line)
{
Runner runner = new Runner();
line = line.Trim();
//to get the name
int delimiterIndex = line.IndexOf(" ");
runner.Name = line.Substring(0, delimiterIndex);
line = line.Replace(runner.Name, "");
line = line.Trim();
//to get age
delimiterIndex = line.IndexOf(" ");
runner.Time = int.Parse(line.Substring(0, delimiterIndex));
line = line.Replace(runner.Time.ToString(), "");
line = line.Trim();
//to get the time
delimiterIndex = line.IndexOf(" ");
runner.Age = int.Parse(line.Substring(0, delimiterIndex));
line = line.Replace(runner.Age.ToString(), "");
line = line.Trim();
return runner;
}
}
}
code is attached
Attachment:
ListOfRunners.zip
Reply
Answers (
1
)
JScript 10.0 compiler /.Net Framework 4.0 Oracle Client
help