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
rachayita jaiswal
NA
217
106.1k
Error Log in asp.net
Aug 26 2013 3:20 AM
Hi, I am creating error log -
public void GetErrorFile(string source, string errormessage)
{
string filename = "C:\\Error_" + DateTime.Now.ToString("dd-MM-yyyy") + ".txt";
if (File.Exists(filename))
{
using (StreamWriter writer = new StreamWriter(filename, true))
{
writer.WriteLine("Time: " + DateTime.Now);
writer.WriteLine("Source: " + source);
writer.WriteLine("Error: " + errormessage);
writer.WriteLine(" ");
}
}
else
{
StreamWriter writer = File.CreateText(filename);
writer.WriteLine("Time: " + DateTime.Now);
writer.WriteLine("Source: " + source);
writer.WriteLine("Error: " + errormessage);
writer.WriteLine(" ");
writer.Close();
}
}
but while creating new error log i am getting error -
Could not find a part of the path 'my path'.....
I am not getting why this error is coming?
Reply
Answers (
6
)
How to bind menu items in to a label
how to show as parent window but not as saperate window