public SteamHelper() { var steamExePath = RegistryKeyHelper.ReadRegistryKey(Registry.CurrentUser, SteamRegistryPath, "SteamExe"); var steamPath = RegistryKeyHelper.ReadRegistryKey(Registry.CurrentUser, SteamRegistryPath, "SteamPath"); if (File.Exists(steamExePath)) { SteamExePath = steamExePath; } if (Directory.Exists(steamPath)) { SteamPath = steamPath; } }
/// <summary> /// 获取最后一次自动登陆steam用户名称 /// </summary> /// <returns></returns> public string GetLastLoginUserName() { return(RegistryKeyHelper.ReadRegistryKey(Registry.CurrentUser, SteamRegistryPath, "AutoLoginUser")); }
/// <summary> /// 设置下次登陆steam用户 /// </summary> public void SetCurrentUser(string username) { RegistryKeyHelper.AddOrUpdateRegistryKey(Registry.CurrentUser, SteamRegistryPath, "AutoLoginUser", username, RegistryValueKind.String); }