NetCoreVersion Property

Applies to TestComplete 15.63, last modified on April 23, 2024

Description

Different .NET Framework versions can be installed on a computer, and these versions can use one or different common language runtimes (CLRs). The OSInfo.NetCoreVersion property returns the version of a .NET Framework CLR by its index in the collection of CLR versions installed on the computer.

Declaration

OSInfoObj.NetCoreVersion(Index)

Read-Only Property String
OSInfoObj An expression, variable or parameter that specifies a reference to an OSInfo object
Index [in]    Required    Integer    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameter:

Index

Specifies the index of the CLR, whose version you want to get.

Property Value

The string that represents the version of the requested CLR.

Example

The following example posts all the versions of Microsoft .NET Framework installed on the local computer.

JavaScript, JScript

function TestProc()
{
  var inf, i;
  inf = Sys.OSInfo;
  for (i = 0; i < inf.NetCoreCount; i++)
  {
    Log.Message( inf.NetCoreVersion( i ) );
  }
}

Python

def TestProc():
  inf = Sys.OSInfo
  for i in range (0, inf.NetCoreCount - 1):
    Log.Message( inf.NetCoreVersion( i ) )

VBScript

Sub TestProc
  Set inf = Sys.OSInfo
  For i = 0 To inf.NetCoreCount - 1
     Log.Message inf.NetCoreVersion( i )
  Next
End Sub

DelphiScript

procedure TestProc;
var
  inf : OleVariant;
  i : integer;
begin
  inf:=Sys.OSInfo;
  for i:=0 to inf.NetCoreCount - 1 do
  begin
    Log.Message( inf.NetCoreVersion( i ) );
  end;
end;

C++Script, C#Script

function TestProc()
{
  var inf, i;
  inf = Sys.OSInfo;
  for (i = 0; i < inf["NetCoreCount"]; i++)
  {
    Log["Message"]( inf["NetCoreVersion"]( i ) );
  }
}

See Also

OSInfo.NetCoreCount

Highlight search results