Since you mentioned in your question that you need this for a WinForms application, the recommended way is to configure the supportedRuntime
element in your application's config file with the appropriate SKU, e.g.
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
Alternatively, if, for whatever reason, you need to check for the presence of .NET Framework 4.8 after starting your application, you can look at the Release
value of the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full
A value of 528040
or higher indicates that .NET Framework 4.8 (or higher) is installed.