Click here to Skip to main content
15,921,660 members
Home / Discussions / C#
   

C#

 
GeneralRe: DirectShow example - PushSource Pin
Ista8-Aug-03 19:18
Ista8-Aug-03 19:18 
GeneralRe: DirectShow example - PushSource Pin
Andy Beamish13-Aug-03 5:09
Andy Beamish13-Aug-03 5:09 
GeneralRe: DirectShow example - PushSource Pin
Andy Beamish13-Aug-03 8:05
Andy Beamish13-Aug-03 8:05 
GeneralQuick question - Formatting Output Pin
IrishSonic7-Aug-03 2:13
IrishSonic7-Aug-03 2:13 
GeneralRe: Quick question - Formatting Output Pin
Rocky Moore7-Aug-03 3:12
Rocky Moore7-Aug-03 3:12 
GeneralRe: Quick question - Formatting Output Pin
James T. Johnson7-Aug-03 3:15
James T. Johnson7-Aug-03 3:15 
QuestionHow to use SendMessage with the param EM_SETPASSWORDCHAR Pin
lithium74567-Aug-03 1:48
lithium74567-Aug-03 1:48 
Generalmysteries of the disapearing text Pin
freshthinking7-Aug-03 0:32
freshthinking7-Aug-03 0:32 
I have written a small debug class so I can echo some statements to the ouput in VS and to a text file, using the StreamWriter class... The problem is, is that the text is never written to the file.

<br />
public class Debug<br />
{<br />
	private StreamWriter _writer;<br />
	private string path;<br />
<br />
	public Debug(string path)<br />
	{<br />
		this.path = path;<br />
		if( File.Exists(path) )<br />
                       _writer = File.AppendText(path)<br />
                else<br />
                       _writer = File.Create(path);<br />
	}<br />
	<br />
	public void WriteLine(string output)<br />
	{<br />
		string s = DateTime.Now + "\t" + output;<br />
<br />
		System.Diagnostics.Debug.WriteLine(s);<br />
		_writer.WriteLine(s);<br />
	}<br />
}<br />


Now this is fairly bog standard code foe writing to a file, and even stranger is if i replace the WriteLine procedure with

<br />
public void WriteLine(string output)<br />
{<br />
        string s = DateTime.Now + "\t" + output;<br />
	System.Diagnostics.Debug.WriteLine(s);<br />
	StreamWriter sw = File.AppendText(this.path);<br />
	sw.WriteLine(s);<br />
	sw.Close();<br />
}<br />


The text is written to the file fine. Can any shed light on this.... What dumbass thing I am I doing wrong?
GeneralRe: mysteries of the disapearing text Pin
Rocky Moore7-Aug-03 2:14
Rocky Moore7-Aug-03 2:14 
GeneralRe: mysteries of the disapearing text Pin
Nnamdi Onyeyiri7-Aug-03 4:12
Nnamdi Onyeyiri7-Aug-03 4:12 
GeneralCursor detection problem Pin
CyberKewl6-Aug-03 23:56
CyberKewl6-Aug-03 23:56 
GeneralRe: Cursor detection problem Pin
Nnamdi Onyeyiri7-Aug-03 11:14
Nnamdi Onyeyiri7-Aug-03 11:14 
GeneralRe: Cursor detection problem Pin
CyberKewl7-Aug-03 14:39
CyberKewl7-Aug-03 14:39 
Generaldata binding Pin
KSEI6-Aug-03 22:14
KSEI6-Aug-03 22:14 
GeneralRe: data binding Pin
Ista8-Aug-03 19:19
Ista8-Aug-03 19:19 
GeneralDetecting the Path. Please help! Pin
deanoA6-Aug-03 21:45
deanoA6-Aug-03 21:45 
GeneralRe: Detecting the Path. Please help! Pin
Alexander Kojevnikov6-Aug-03 21:52
Alexander Kojevnikov6-Aug-03 21:52 
GeneralRe: Detecting the Path. Please help! Pin
deanoA6-Aug-03 21:56
deanoA6-Aug-03 21:56 
GeneralRe: Detecting the Path. Please help! Pin
Alexander Kojevnikov6-Aug-03 22:04
Alexander Kojevnikov6-Aug-03 22:04 
GeneralRe: Detecting the Path. Please help! Pin
deanoA6-Aug-03 22:13
deanoA6-Aug-03 22:13 
GeneralRe: Detecting the Path. Please help! Pin
Alexander Kojevnikov6-Aug-03 22:08
Alexander Kojevnikov6-Aug-03 22:08 
GeneralRe: Detecting the Path. Please help! Pin
deanoA6-Aug-03 22:15
deanoA6-Aug-03 22:15 
GeneralRe: Detecting the Path. Please help! Pin
Alexander Kojevnikov6-Aug-03 22:56
Alexander Kojevnikov6-Aug-03 22:56 
GeneralRe: Detecting the Path. Please help! Pin
deanoA6-Aug-03 23:23
deanoA6-Aug-03 23:23 
GeneralRe: Detecting the Path. Please help! Pin
Alexander Kojevnikov7-Aug-03 0:29
Alexander Kojevnikov7-Aug-03 0:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.