Use hexadecimal strings for OS-wide resources

base64 slash character can cause problems with filepaths, besides, it's best to use ASCII only there due to various OS limitations
This commit is contained in:
JustArchi
2020-05-21 23:42:32 +02:00
parent 1c18fab68e
commit 8db90b6c2f
2 changed files with 2 additions and 2 deletions

View File

@@ -114,7 +114,7 @@ namespace ArchiSteamFarm {
return false;
}
string uniqueName = "Global\\" + GetOsResourceName(nameof(SingleInstance)) + "-" + Convert.ToBase64String(Encoding.UTF8.GetBytes(Directory.GetCurrentDirectory()));
string uniqueName = "Global\\" + GetOsResourceName(nameof(SingleInstance)) + "-" + BitConverter.ToString(Encoding.UTF8.GetBytes(Directory.GetCurrentDirectory())).Replace("-", "");
Mutex singleInstance = new Mutex(true, uniqueName, out bool result);