streamwriter

  • Thread starter Thread starter Guest
  • Start date Start date
Hi CJ,

What do you mean by dynamic files?
Having a StreamWriter reference you can certainly change it any time you want.

StreamWriter sw;

if(condition1)
sw = new StreamWriter(param1);
else if(condition2)
sw = new StreamWriter(param2);
else
sw = new StreamWriter(param3);
 
CJ said:
Can one streamwriter object create dynamic files? in nested if statement?
example of code

It would help if you could explain what you meant by "dynamic files".
 
CJ,

If you get a read only error, then your parameter is either incorrect, the file is used by another program or another file handle in your own program.
If you reuse a StreamWriter remember to call Close() on it to release the current file before you use it on another file.
 
Back
Top