Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
IndexOutOfRangeException exception is thrown
nigel drakes
Jul 5 2010 1:41 PM
3.1k
Reply
I keep getting this error I can not figure out why
IndexOutOfRangeException
exception is thrown
Here is the code can someone help
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Windows.Forms;
using
System.IO;
namespace
WindowsFormsApplication19
{
public
partial
class
Form1
:
Form
{
public
Form1()
{
InitializeComponent();
}
private
void
button1_Click(
object
sender,
EventArgs
e)
{
string
line;
string
[] row =
new
String
[3];
StreamReader
file =
new
StreamReader
(
"c:\\dell\\first.txt"
);
while
((line = file.ReadLine()) !=
null
)
{
row = line.Split(
','
);
textBox2.Text += (row[1]);
textBox3.Text += (row[2]);
}
file.Close();
}
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Need outlook API
web problem...check proxy validation