I want to use RegistryKey in Unity.

I want to use RegistryKey to the game.
We’ve added a variety of dll to this end.
But it did not go well.

It is my Code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Runtime.InteropServices;
using System.Drawing;
using System.IO;
using Microsoft.Win32;

public class Method_ChangeBackground : MonoBehaviour
{
public void Set(Style style)
{

img = bitmaps[Background_Num];

string tempPath = Path.Combine(Path.GetTempPath(),
“wallpaper.bmp”);

img.Save(tempPath, System.Drawing.Imaging.ImageFormat.Bmp);

//Error here_RegistryKey not found
RegistryKey key = Registry.CurrentUser.OpenSubKey(@“Control
Panel\Desktop”, true);
}
}

Care to mention what “did not go well” means?

If you’re trying to use the registry for stylistic reasons, like to make a filesystem interaction game, use a daemon or “bat” scripts.