C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » Visual Studio »

Know About TextWriterTraceListener Class (Csharp)


Posted Date: 31 Aug 2009    Resource Type: Articles    Category: Visual Studio
Author: VeerabaguMember Level: Gold    
Rating: 1 out of 5Points: 8



Know About TextWriterTraceListener Class (Csharp)



Description:
Directs tracing or debugging output to a TextWriter or to a Stream, such as FileStream.
Namespace you have to use
System.Diagnostics

The TextWriterTraceListener class provides the Writer property to get or set the text writer that receives the tracing or debugging output

Example

namespace debugTrace
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
Stream myFile = File.Create("Veera.txt");
TextWriterTraceListener myTextListener = new TextWriterTraceListener(myFile);
Trace.Listeners.Add(myTextListener);
Trace.Write("you can write some value here");
Trace.Flush();
MessageBox.Show("Listener File created Successfully");
}
}
}


Code Explanation

we create one stream then we pass parameter to TextWriterTraceListener
you can the pass string filename, stream and TextWriter as parameter for TextWriterTraceListener then we add the TextWriterTraceListener class object to listeners then we write the output just execute the program you will come to know the use of TextWriterTraceListener...



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Know About TextWriterTraceListener Class (Csharp)  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Multi Thread implementation using Background worker process
Previous Resource: How to Start Mobile Application on Windows?
Return to Discussion Resource Index
Post New Resource
Category: Visual Studio


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use