// Create a new FileStream object using (FileStream fs = new FileStream("example.txt", FileMode.Create)) { // Set the AsStorage property to true fs.AsStorage = true; // Write some data to the file byte[] data = Encoding.UTF8.GetBytes("Hello world!"); fs.Write(data, 0, data.Length); // Close the file fs.Close(); }In this example, we create a new FileStream object and set its AsStorage property to true. We then write some data to the file and close it. The changes to the file are guaranteed to be committed to disk before returning control.