Re: StreamWriter Problem
- From: kimiraikkonen <kimiraikkonen85@xxxxxxxxx>
- Date: Sat, 8 Dec 2007 12:02:33 -0800 (PST)
On Dec 8, 8:35 pm, "Teemu" <tsir...@xxxxxxxxxxx> wrote:
"kimiraikkonen" <kimiraikkone...@xxxxxxxxx> kirjoitti viestissänews:6b5e9f3a-f116-47d0-85ac-f5a089f4e445@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Teemu and Tom,
I'm currently using this code for "try" area with getting this
exception rarely but
not solved completely:
myStreamWriter = System.IO.File.CreateText(Save.FileName)
myStreamWriter.Write(TextBox1.Text)
myStreamWriter.Flush()
myStreamWriter.Close()
myStreamWriter.Dispose()
However, i added a "yesnocancel" msgbox question inside exception area
against the problem, when this exception occurs user can retry save
process
or cancel save process. At least this does it temporarily but i wish
i didn't have to yesnocancel question prompt to retry save process.
Your problem sounds so weird that I can't figure out any reason for this if
the file is really not used by another program.
Maybe you could use a tool like thishttp://software.techrepublic.com.com/download.aspx?&kw=File+lock&doci...
to check out which process has locked the file when the exception occurs.
-Teemu
Hi,
Thanks for the tool but it did nothing, however this problem happens
very rarely for the latest code that i've edited, but and happened
again. With exception window is stayed open, i used the tool you
recommended, but it didn't report any process that locks my text file,
only says: "You do not have sufficient access to 1 processes". I have
all the rights as i'm admin, and i saw some right-related problem
about that exception, but i couldn't find an exact solution.
Additionaly, to test the tool which you pointed out, while an mp3
audio file is being played by a player, i used that tool to report if
it reports correct process(player) as it's used by, but nothing is
reported. This tool is not reliable.
.
- Follow-Ups:
- Re: StreamWriter Problem
- From: Jack Jackson
- Re: StreamWriter Problem
- From: Teemu
- Re: StreamWriter Problem
- References:
- StreamWriter Problem
- From: kimiraikkonen
- Re: StreamWriter Problem
- From: kimiraikkonen
- Re: StreamWriter Problem
- From: Tom Shelton
- Re: StreamWriter Problem
- From: kimiraikkonen
- Re: StreamWriter Problem
- From: Tom Shelton
- Re: StreamWriter Problem
- From: kimiraikkonen
- Re: StreamWriter Problem
- From: Teemu
- StreamWriter Problem
- Prev by Date: Re: IHTMLDocument Intellisense Blank
- Next by Date: Re: StreamWriter Problem
- Previous by thread: Re: StreamWriter Problem
- Next by thread: Re: StreamWriter Problem
- Index(es):
Relevant Pages
|
Loading