Advertisement
3DotDev

Détecter si le Framework 4 est installé

Aug 16th, 2013
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.80 KB | None | 0 0
  1. '########################################################
  2. ' Credits 3DotDev from http://3dotdevcoder.blogspot.fr/
  3. '########################################################
  4. Public Function Framework4isInstalled() As Boolean
  5.      Try
  6.         AppDomain.CurrentDomain.Load("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
  7.         Return True
  8.      Catch
  9.         Return False
  10.      End Try
  11.      Return False
  12. End Function
  13. '#########################################################
  14. '               Une autre possibilité
  15. '#########################################################
  16. Public Function Framework4isInstalled()
  17.     If Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion.StartsWith("v4") Then
  18.         Return True
  19.      End If
  20.      Return False
  21. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement