This is not really a question. Anyway, you can find one of the most rudimentary and simplest way to record voice in .NET and store the result in a file in my article: Practical Sound Recorder with Sound Activation
Note that all the code you are asked about is fully shown in the text of the article itself. The rest of the code you can download is just the UI.
There are many different ways to solve such problems. This is the way specific to oldest Windows API and is the simplest.