Cyrus
Tue Nov 11 03:28:10 CST 2003
even i close the filestream after closing the streamwriter
the error still happen....
"Cyrus" <CyrusChiu@kfsolution.com> wrote in message
news:euDyhn$pDHA.2404@TK2MSFTNGP12.phx.gbl...
> StreamReader sr = new
> StreamReader(File.OpenRead(Environment.CurrentDirectory +
"\\Inipro.dat"));
> // StreamReader sr = new StreamReader(keyFile.OpenRead());
>
> if (sr.ReadLine() != null)
> {
> prodCode = this.Decode(sr.ReadLine());
> actCode = this.Decode(sr.ReadLine());
> pass = VerifyActCode();
> }
> sr.Close();
>
> UnicodeEncoding byteConverter = new UnicodeEncoding();
> // StreamWriter sw = new StreamWriter(keyFile.OpenWrite());
> StreamWriter sw = new
> StreamWriter(File.OpenWrite(Environment.CurrentDirectory +
"\\Inipro.dat"));
>
> sw.WriteLine(byteConverter.GetString(this.GetRandomBytes()));
> sw.WriteLine(this.Encode(prodCode));
> sw.WriteLine(this.Encode(actCode));
> sw.Flush();
> sw.Close();
>
>
>
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
> news:boom95$1ghmjg$6@ID-208219.news.uni-berlin.de...
> > * "~cch~" <cyruschiu@hkbn.net> scripsit:
> > > i use streamreader and streamwriter
> > > i did close them.
> >
> > Post the code snippet you use to perform the operation.
> >
> > --
> > Herfried K. Wagner
> > MVP ?VB Classic, VB.NET
> > <
http://www.mvps.org/dotnet>
> >
> > <
http://www.plig.net/nnq/nquote.html>
>
>