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
Rano AH
NA
176
111.6k
Log file Path
Sep 7 2013 5:06 AM
Hello
I'm trying to set a location/Path for my logFile but I cannot. It keeps creating it in the debug folder
StreamWriter logFile;
if (!File.Exists("logFile.txt"))
{
logFile = new StreamWriter(@"C:\logFile.txt");
}
else
{
logFile = File.AppendText("logFile.txt");
}
What is wrong in my code? and what if I need to create a specific folder (LogFolder) under C: Directory for example (if the folder does not exist) so that I can create the logFile inside of it.
Reply
Answers (
3
)
Predetermined characters
controls on the form is not displayed