Hi all,

The project I am currently working on is an Address Book which works off a csv (specification takes the mick as a database would be so much easier), the method to write the lines of information into the CSV is in the class DataLayer and takes a String: filepath and an AddressBook: addressbook.

My question is how do i get the filepath selected from a savedialog and pass it through to the method in the class as I cannot see how using intellisense and MSDN.

Thanks,

Mike

Recommended Answers

All 2 Replies

It really depends on the class interface.
It also depends on your actual question.

Are you asking how to get the filepath FROM a save dialog box?

SaveFileDialog sfd = new SaveFileDialog();
sfd.ShowDialog();
MessageBox.Show(sfd.FileName);

Are you asking how to pass the filepath to the class?
This will REALLY depend on the constructor of the class.

Ooooh filename passes both the path and name? Thats where I was going wrong :) Thankyou very much thines

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.