Can't create file: "File is inaccesible due to its protection level" [SOLVED]

Hello everyone, I’m new in Unity.
I’m trying to create some .json files but when I use the “File.*” expression this return me this error: ‘File’ is inaccessible due to its protection level. I have searched for access method error but I can’t find nothing. What I can do?

Thanks for the help.

Here the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.IO;

public class TestWriter : MonoBehaviour
{
    [System.Serializable]

    public class InfoPlayer
    {
        public string name;
        public float health;
        
    }

    public InfoPlayer player = new InfoPlayer();

    public void OutputJSON()
    {
        string output = JsonUtility.ToJson(player);
        string path  = Application.dataPath+"/text.json";
        print(path);
        File.WriteAllText(path,output);
    }
}

Solved: I changed “File.WriteAllText(path,output)” with “System.IO.File.WriteAllText(path,output)” and it works.

P:S. For see the file you have to change window and later come back to Unity