|
이 문서는 기계로 번역한 것입니다. 원본 텍스트를 보려면 포인터를 문서의 문장 위로 올리십시오. 추가 정보
|
번역
원본
|
Int64.Parse 메서드 (String, IFormatProvider)
네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)
매개 변수
- s
- 형식: System.String
변환할 숫자가 들어 있는 문자열입니다.
- provider
- 형식: System.IFormatProvider
s에 대한 문화권별 형식 지정 정보를 제공하는 개체입니다.
| 예외 | 조건 |
|---|---|
| ArgumentNullException | |
| FormatException | |
| OverflowException |
protected void OkToLong_Click(object sender, EventArgs e) { string locale; long number; CultureInfo culture; // Return if string is empty if (String.IsNullOrEmpty(this.inputNumber.Text)) return; // Get locale of web request to determine possible format of number if (Request.UserLanguages.Length == 0) return; locale = Request.UserLanguages[0]; if (String.IsNullOrEmpty(locale)) return; // Instantiate CultureInfo object for the user's locale culture = new CultureInfo(locale); // Convert user input from a string to a number try { number = Int64.Parse(this.inputNumber.Text, culture.NumberFormat); } catch (FormatException) { return; } catch (Exception) { return; } // Output number to label on web form this.outputNumber.Text = "Number is " + number.ToString(); }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008(서버 코어 역할은 지원되지 않음), Windows Server 2008 R2(서버 코어 역할은 SP1 이상에서 지원, Itanium은 지원되지 않음)
.NET Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.