Home  |  Delphi .net Home  |  System.Version  |  ToString Method
  
ToString  
Method  
Builds the Version information into a single string
Version Class
System NameSpace
CF1.  Function ToString : String;
CF2.  Function ToString ( Count : Integer ) : String;
CF : Methods with this mark are Compact Framework Compatible
Description
The Version Major, Minor, Build and Revisions fields are all stored into a string.
 
Optionally, the build may be limited to the first Count of these fields.
Microsoft MSDN Links
System
System.Version
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

var
  verStr : String;

begin
  // Default : all version fields
  verStr := Environment.OSVersion.Version.ToString;
  Console.WriteLine('verStr = ' + verStr);

  // Just the Major and Minor version fields
  verStr := Environment.OSVersion.Version.ToString(2);
  Console.WriteLine('verStr = ' + verStr);

  Console.ReadLine;
end.
   verStr = 5.1.2600.0
   verStr = 5.1
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author