C# write file to MyDocuments
Using class System.Environment you can get paths of special Windows folders such as Program Files, My Documents and others. The list of available values is stored in enum object Environment.SpecialFolder (Fugure 1).
The code for receiving and using of My Documents folder path is below. The program writes file in My Documents folder and reads it.
static void Main(string[] args)
{
string myDocuments = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string filename = Path.Combine(myDocuments, "helloworld.txt");
File.WriteAllText(filename, "Hello world");
string content = File.ReadAllText(filename);
Console.WriteLine(content);
}

Custom Label with multiple styles in TextField of Fluent UI
First impressions after using the new SPFX 1.22.2 with Heft
Changing the Runtime Environment for an Azure App Service