Issue writing to single file in Web service in .NET

前端 未结 11 1822
天涯浪人
天涯浪人 2020-12-10 17:37

I have created a webservice in .net 2.0, C#. I need to log some information to a file whenever different methods are called by the web service clients.

The problem

11条回答
  •  遥遥无期
    2020-12-10 17:51

    Joel: When you say "queue line" do you mean creating a separate thread that runs in a loop to keep checking the queue as well as write to a file when it is not locked?

    Yeah, that's basically what I was thinking. Have another thread that has a while loop until it can get access to the file and save, then end.

    But you would have to do it in a way where the first thread to start looking gets access first. Which is why I say queue.

提交回复
热议问题