반응형






ex. dialog창을 통해서 파일을 한꺼번에 열었을 경우 파일값을 배열에 넣어서 활용하기.



                openPanel.Filter = "ImageFile (*.jpg)|*.jpg|All files (*.*)|(*.*)";

                openPanel.Multiselect = true;

                if (openPanel.ShowDialog() == DialogResult.OK)

                {


                                string[] arr = openPanel.FileNames;

                                textBox2.Text = openPanel.FileName;




for (int i = 0; i < arr.Length ; i++)

{

string fullPathName = Convert.ToString(arr[i]);

}

}





길이를 구하려면 배열이름.length - 형식은 int


배열 arr의 0번째 값을 구하고 싶으면 arr[0]

(모든 배열은 0번째부터 시작한다)


반응형

+ Recent posts