My.Computer.Registry vs Microsoft.Win32.Registry

OSVBNET 1,386 Reputation points
2022-04-20T02:45:22.15+00:00

Hey all,
Which one do you prefer?
I remember I've seen advises to reduce using Win32 APIs!
And Visual Basic APIs on the other side!
Any tip on which to use?
Thanks :)

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,659 questions
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 28,941 Reputation points Microsoft Vendor
    2022-04-20T07:42:45.75+00:00

    Hi @OSVBNET ,
    My.Computer.Registry and Microsoft.Win32.Registry can achieve the same function.
    But Microsoft.Win32.Registry is suitable for more products.
    https://learn.microsoft.com/en-us/dotnet/api/microsoft.win32.registry?view=net-6.0#applies-to
    https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.myservices.registryproxy?view=windowsdesktop-6.0#applies-to
    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful