|
Tento článek byl přeložen strojově počítačem. Původní text zobrazíte přesunutím ukazatele myši nad jednotlivé věty článku. Další informace
|
Překlad
Originál
|
Int16.MaxValue – pole
.NET Framework 4.5
Obor názvů: System
Sestavení: mscorlib (v mscorlib.dll)
long[] numbersToConvert = {162345, 32183, -54000}; short newNumber; foreach (long number in numbersToConvert) { if (number >= Int16.MinValue && number <= Int16.MaxValue) { newNumber = Convert.ToInt16(number); Console.WriteLine("Successfully converted {0} to an Int16.", newNumber); } else { Console.WriteLine("Unable to convert {0} to an Int16.", number); } } // The example displays the following output to the console: // Unable to convert 162345 to an Int16. // Successfully converted 32183 to an Int16. // Unable to convert -54000 to an Int16.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (role Server Core není podporována), Windows Server 2008 R2 (role Server Core je podporována s aktualizací SP1 nebo novější, architektura Itanium není podporována)
.NET Framework nepodporuje některé verze platforem. Seznam podporovaných verzí naleznete v tématu Požadavky na systém rozhraní .NET framework.