File.WriteAllBytes in C#?

I’m trying to save save files as PNGs to allow them to be shared more easily over the internet, but I’ve only ever learned C#.

I was using the reference but when it’s set to C# not Js it doesn’t change the code.

The problem is, I get the error: “The name `File’ does not exist in the current context” off the line: “File.WriteAllBytes(Application.dataPath + “/…/data.png”, bytes);” I have no clue what to do as I took the code straight off the unity script reference site.

Any help would be amazing,
David :slight_smile:

Import the System.IO namespace, or explicitly specify it when using File.