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
Neha Alam
NA
3
0
urgent c# problem
Jul 1 2009 6:13 AM
Hello.
i am a total newbie in c#. I have this assignment where i have to read data from a .txt file in an array. I have tried this code and build it. Now will u please tell me how can I see the output?? and why it isnt working??
Thank you. I am attaching my code:-
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;
using
System.Collections;
namespace
WindowsFormsApplication1
{
public
partial
class
Form1
:
Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Load(
object
sender,
EventArgs
e)
{
}
private
void
button1_Click(
object
sender,
EventArgs
e)
{
StreamReader
objReader =
new
StreamReader
(
"c:\\test.txt"
);
string
sLine =
""
;
ArrayList
arrText =
new
ArrayList
();
while
(sLine !=
null
)
{
sLine = objReader.ReadLine();
if
(sLine !=
null
)
arrText.Add(sLine);
}
objReader.Close();
foreach
(
string
sOutput
in
arrText)
Console
.WriteLine(sOutput);
Console
.ReadLine();
}
private
void
button2_Click(
object
sender,
EventArgs
e)
{
}
}
}
Reply
Answers (
1
)
reachin the class' properties from a class define in the former
How to Add Flash Video In Form In C# or VB.Net