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
Jeffrey Webster
NA
1
0
Simple TextRead program not working
May 17 2009 4:48 PM
Hi,
I'm currently making the transition from VB to C# and seem to by having some trouble with the syntax.
Here's the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace TextReaderConsole1
{
class Program
{
static void Main(string[] args)
{
TextReader reader = new StreamReader("c:\textdocs\text.txt");
string line;
while ((line = reader.ReadLine()) != null)
{
Console.WriteLine(line);
}
reader.Close();
}
}
}
It keeps giving me an "Illegal characters" message. But I don't see any illegal characters. I've tried changing everything to lowercase, including the folder and file it's referencing. The compiler is still complaining.
Any help would be appreciated.
Jeff
Reply
Answers (
1
)
Help in picturebox
Add items to listview