Hi,
Here is a small example function. What I would like to know is when I
should be using null:
private bool MyTestFunc(stri ng Message)
{
StreamWriter sw=null;
string str=null;
sw = new StreamWriter(FI LE_PATH,true);
//Do some stuff with the SW
str = String.Format(@ "{0}|{1}|",CLAS S_NAME,message) ;
sw.WriteLine(st r);
sw.Close();
//Not sure what to do here, but here is my guess
sw=null;
str=null;
//If I didnt set these to null, would that mean the
//The GC wouldnt clean these objects up?
return true;
}
Any help on this would be appreciated.
Regards,
Steven
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!