Write log file txt with Asp.net

Hi! I would have to do something like this to write a TXT file log.
I found something like this, but I'm reaching for an ASP.net version. Has anyone ever realized such a thing?

Hi.
Wappler extensions are not available for ASP .NET unfortunately.
Before it was even introduced, for all server models… we made use of API Action.
Here’s a summary of how it would work:

  1. Create a separate ASP/ASPX/ASHX file with custom code.
  2. This page will expect data in POST, and use that to write to a file. File name could be sent from POST as well.
  3. In Wappler, use API Action to just call this file - https://yourdomain.com/logger.aspx - and send required data via POST.
  4. For security, you could set a HEADER ‘token’ with some static value, and check that on the page. So even if someone gets a hold of your logger.aspx page URL, they won’t be able to call it without the valid HEADER token.