Re: Process used by another
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Fri, 29 Apr 2005 14:06:48 +0200
"Josema" <Jestrade@xxxxxxx> wrote in message
news:C8AB57B7-74AD-4ED0-8364-3419DC27E1F2@xxxxxxxxxxxxxxxx
> Hi,
>
> i have a Web application and i get this error:
>
> The process cannot access the file
> "c:\inetpub\wwwroot\dotnet\Soluciones\Calculations\PhoneTariffs\Errors\Log.txt"
> because it is being used by another
>
> The code that generates this error is the following:
>
> Directory.CreateDirectory("c:\inetpub\wwwroot\Error");
> File.Create("c:\inetpub\wwwroot\Error\log.txt");
>
> System.IO.StreamWriter StreamLog=new
> System.IO.StreamWriter("c:\inetpub\wwwroot\Error\log.txt");
> StreamLog.Write(e.Message);
> StreamLog.Close();
>
> How could avoid that error?.
> --
> Thanks a lot
> Kind Regards.
> Josema
You open the same file two times here.
There is no need for - File.Create("c:\inetpub\wwwroot\Error\log.txt");
Willy.
.
- Follow-Ups:
- Re: Process used by another
- From: Steve Walker
- Re: Process used by another
- References:
- Process used by another
- From: Josema
- Process used by another
- Prev by Date: Swapping of event handlers
- Next by Date: Re: selected row
- Previous by thread: Process used by another
- Next by thread: Re: Process used by another
- Index(es):
Relevant Pages
|