반응형




구하고자 하는 배열명 : arr 


Ubound(arr) - LBound(arr)

반응형

'Programming > VB.NET' 카테고리의 다른 글

[vb.net]소스 글자 크기, 색상 변경  (0) 2019.07.23
[vb.net]On Error GoTo 0  (0) 2018.10.17
VB MSCOMCTL.OCX를 로드할 수 없습니다  (1) 2017.08.22
반응형






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번째부터 시작한다)


반응형
반응형




using System.Collections.Generic;




List<String> data = new List<String>();

 for (int i = 0; i == MainlistView.Items.Count - 1; i++)

{

    string filename = MainlistView.Items[i].SubItems[5].Text; //[]안에는 넣어주고자 하는 subitem이 몇번째인지 넣어주면 됨.

    data.Add(filename);

}

반응형

+ Recent posts