auto generate file & info

mail@pastecode.io avatar
unknown
csharp
a year ago
759 B
2
Indexable
Never
using UnityEngine;
using System.IO;
using static System.Environment;
using System;

public class JsonFile : MonoBehaviour 
{
    

    public void Start()
    {
        CreateFile2();
    }

    public void CreateFile2()
    {
        string folderName = ".openai";
        string fileName = "auth.json";
        string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), folderName);
        string filePath = Path.Combine(folderPath, fileName);

        if (!Directory.Exists(folderPath))
        {
            Directory.CreateDirectory(folderPath);
        }
                              FileName     Info
        string jsonData = "{\"########\":\"#####\" }";
        File.WriteAllText(filePath, jsonData);
    }
}