2
Answers

Accessing ArrayList Across Mutiple Windows Forms

ianparkins

ianparkins

20y
1.8k
1
Hi all, I am designing a project that contains mutiple windows forms. In my Main Form I declared an ArrayList variable to store various objects. I have an "Add" button on the Main Form which loads a new form where the user can enter information (creating an object behind the scenes). I want to add this object to my Array List in my Main Form. Can anyone give me some tips on an efficient way to do this? Thanks, Zach(Nevermore)
Answers (2)
0
Abhishikt Kujur

Abhishikt Kujur

NA 3 0 18y
Hi all,
        After searching a while i got some results...I had to search files from a server location so it was needed a path to map with server which I did using,        
                            string StrRoot_E = Server.MapPath("../FolderName1/");
var StrRoot_E contains the string "../FolderName1/" is the path for the specific server Directory and to extract files of specific types,
                           string files_E() = Directory.GetFiles(StrRoot_E, "*.zip");
"*.zip " is the filetype which is stored in an array of strings,and then you can extract each file from that array of strings and can use for purpose.

Method Server.MapPath() takes string argument which is the physical path in your server while method Directory.GetFiles() takes two arguments, the Path of the Directory and the fileType both as strings.