1
Array list
을 c#
에 작성했으며 사용자가 양식의 데이터 입력을 통해 목록에 추가 할 수 있기를 바랍니다. 다음 코드를 입력했지만 오류가 발생했습니다. "Input string was not in the correct format."
사용자 입력을 가능하게하기 위해이를 수정하는 방법을 모르겠습니다.올바른 입력 문자열이 배열 목록의 올바른 형식이 아닙니다.
Arraylist hotelRooms = new ArrayList
Public void AddCurrentItem()
{
HotelRoom hotelRooms = new HotelRoom
Int.Parse(textboxRoomNumber.Text),comboBoxRoomType. Text, int.Parse (comboBoxFloorNumber.Text), comboBoxSeaView. Text, decimal.Parse (textBoxRoomRate. Text), comboBoxBooked. Text);
hotelRooms. Add(hotelRooms)
}
를? 누락 된 parantheses aftr 새로운 호텔 룸 단지 오타가 있습니까? – scheien
int로 구문 분석하는 텍스트 상자에 숫자가 포함되어 있는지 확인하십시오. –
[try-catch] (http://msdn.microsoft.com/ru-ru/library/0yd65esw.aspx), Luke :-) – Grundy