Tries to convert the string representation of a version number to an equivalent Version object, and returns a value that indicates whether the conversion succeeded.
Assembly: mscorlib (in mscorlib.dll)
- Type: System::String
A string that contains a version number to convert.
- Type: System::Version%
When this method returns, contains the Version equivalent of the number that is contained in input, if the conversion succeeded, or a Version object whose major and minor version numbers are 0 if the conversion failed. If input is nullptr or String::Empty, result is nullptr when the method returns.
Return ValueType: System::Boolean
true if the input parameter was converted successfully; otherwise, false.
The method is similar to the Parse method, except that it does not throw an exception if the conversion fails. Instead, it returns false if input is null, has fewer than two or more than four components, has at least one component that is not an integer, has at least one component that is less than zero, or has at least one component that is greater than Int32::MaxValue.
For the parse operation to succeed, the input parameter must be in the following format:
where major, minor, build, and revision are the string representations of the version number's four components: major version number, minor version number, build number, and revision number. Optional components are shown in square brackets ([ and ]). The components must appear in order, and must be separated by periods.
.NET FrameworkSupported in: 4.5, 4
.NET Framework Client ProfileSupported in: 4
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
.NET for Windows Phone appsSupported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.