public void SetValue(string valName, string value) { int status = SafeNativeMethods.RegSetValueEx(this, valName, 0, SafeNativeMethods.REG_SZ, value, (value.Length * 2) + 2); if (status != SafeNativeMethods.ERROR_SUCCESS) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(status)); } }
public void SetValue(string valName, string value) { int error = SafeNativeMethods.RegSetValueEx(this, valName, 0, 1, value, (value.Length * 2) + 2); if (error != 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(error)); } }