라벨이 json인 게시물 표시

C# (WPF)으로 로또 번호 생성 프로그램을 만들어 보자 (4)

이미지
    C# (WPF)으로 로또 번호 생성 프로그램을 만들어 보자 (4) 이전 (이전포스트) 엔 선택한 버튼의 숫자를 텍스트 박스에 넣어주는 것과, 6개의 번호를 다 랜덤으로 만들어 주는 메소드를 만들었었다.  이번엔 몇개의 특정 번호는 내가 선택하고 나머지 숫자들을 랜덤으로 만들어 주는 버튼의 이벤트 메소드를 만들어야 겠다. 근데 저번에 만든 소스에서 조건만 넣어주면 될 것 같아서 메소드에 매개변수를 추가 해서 조건만 넣어 주었다. private void rand_num_create ( bool bAll_rand) { Random cRandomobj = new Random(); int [] iaRand_num = new int [ 6 ]; int iRandbuff = 0 ; int iBoxCount = 1 ; if (bAll_rand== true ) { button_clear(); iCount = 0 ; } else if (iCount< 6 ) { int iRandA_count_buff = 0 ; for ( int k = 1 ; k < 46 ; k++) { if (baLotto_number[k] == true ) { iaRand_num[iRandA_count_buff++] = k; } } } while (iCount < 6 ) { iRandbuff = cRandomobj.Next( 1 , 46 ); if (!Array.Exists(iaRand_num, x => x == iRandbuff)) { iaRand_num[iCount++] = iRandbuff; baLotto_number[iRandbuff] = true ; caButton[iRandbuff].Background = new SolidColorBrush((Co...