title: save raw post data to file in asp.net
body: <p>This is the first time i am using stackoverflow . I made this script in <code>php</code> to save raw post data to a file . I will only post the part that is the most important :</p>
  
  <pre><code>&lt;?php
  $jsonString = file_get_contents("php://input");
  $jfile = rand(100000,999999);
  file_put_contents($jfile,$jsonString);
  ?&gt;
  </code></pre>
  
  <p>I need this script to be converted in an <code>asp.net</code> but I don't know much about .net, I searched all over but I couldn't find anything. I would also need to know how a client can send the data. </p>
  
  <p>something like this ?</p>
  
  <pre><code>    using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using System.Web.Mvc;
  
      namespace WebApplication1.Controllers
      {
          public class HomeController : Controller
          {
              public HttpResponseMessage Post(string person)
              {
                  System.IO.File.WriteAllText(@"C:\Users\Public                \TestFolder        \WriteText.txt", person);
                  return Request.CreateResponse(HttpStatusCode.OK);
              }
          }
      }
      }
  </code></pre>