天天看點

把生成的json檔案儲存到指定項目檔案夾

/// <summary>
    /// 把生成的json檔案儲存到指定項目檔案夾
    /// </summary>
    /// <param name="JsonValue">json值</param>
    public void SaveJson(string JsonValue)
    {
         string path = Application.dataPath+@"\\json\\Name.json";
        FileStream FsJsonFile = new FileStream(path, FileMode.Append, FileAccess.Write);
        StreamWriter SwJsonFile = new StreamWriter(FsJsonFile);

        SwJsonFile.WriteLine(JsonValue);

        SwJsonFile.Flush();
        SwJsonFile.Close();
        FsJsonFile.Close();
    }