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
Eben Coarsey
NA
2
15.1k
Beginner Problem with StreamWriter
Oct 25 2010 1:26 PM
I am using StreamWriter to debug a stock trading program and my code creates the file, but will not write to it. I am sure I am missing something simple. I know the method is being used because the D() command you see writes to a debug window. I am not sure what I am missing but the file is created, but always empty.
public class SterlingDebug : ResponseTemplate
{
StreamWriter writer = new StreamWriter(@"C:\Documents and Settings\ecoarsey\SterlingIssue10222010.txt");
int i = 0; public override void GotTick(Tick tick) {
i++; if (i < 11) { D(tick.ToString()); writer.WriteLine("Tick #: {0}",i); }
}
}
Reply
Answers (
2
)
How to Send Email In Asp.net 2.0
Iterating through generic collections