[SOLVED] Problem detecting kernel version

Discussion in 'Mixed Languages' started by Muerto, May 30, 2015.

  1. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,858
    2,117
    60
    #1 Muerto, May 30, 2015
    Last edited: Jan 12, 2021
    ...
     
  2. Michaela Joy

    Michaela Joy MDL Crazy Lady

    Jul 26, 2012
    4,071
    4,652
    150
    @Dev:
    Maybe assign "Environment.OSVersion.VersionString" to a string variable and then write the string to the console?

    Just a guess :eek::

    :MJ
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #3 CODYQX4, May 30, 2015
    Last edited: Apr 12, 2019
    .
     
  4. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,718
    18,710
    340
    @CODYQX4

    Exactly! I've seen (& reported) no of applications detecting 8.1 as 6.2.

    o_O
     
  5. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,858
    2,117
    60
    #5 Muerto, May 30, 2015
    Last edited: Jan 12, 2021
    (OP)
    ...
     
  6. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #6 CODYQX4, May 30, 2015
    Last edited: Apr 12, 2019
    .
     
  7. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,858
    2,117
    60
    #7 Muerto, May 31, 2015
    Last edited: Jan 12, 2021
    (OP)
    ...
     
  8. Alphawaves

    Alphawaves Super Moderator/Developer
    Staff Member

    Aug 11, 2008
    6,228
    22,297
    210
    #8 Alphawaves, May 31, 2015
    Last edited by a moderator: Apr 20, 2017
    How about something like:
    Code:
     FileVersionInfo fv = FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + @"\kernel32.dll");
                string version = fv.ProductMajorPart + "." + fv.ProductMinorPart;
    :eek:

    EDIT:
    oops forgot your VB guy:
    Code:
    Dim fv As FileVersionInfo = FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\kernel32.dll")
            Dim version As String = fv.ProductMajorPart & "." & fv.ProductMinorPart
     
  9. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,858
    2,117
    60
    #9 Muerto, May 31, 2015
    Last edited: Jan 12, 2021
    (OP)
    ...