C#

[C#]Random class 예제

선영아 사랑해 2016. 5. 6. 10:00

Random class는 난수를 생성 할 때 사용하는 클래스입니다.


Random rnd = new Random();


//지정된 범위 내의 임의의 정수를 반환합니다.

int index = rnd.Next(1, 100); //1 ~ 100까지 랜덤으로 추출

'C#' 카테고리의 다른 글

[C#]Listview에 이미지 출력 예제  (0) 2016.05.11
[C#]Listview column forecolor 변경 예제  (0) 2016.05.10
[C#]CheckedListBox 예제  (0) 2016.05.04
[C#]BindingNavigator 예제  (0) 2016.05.03
[C#]App.config 예제  (0) 2016.04.28