0

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

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Mike Askew
1

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.

Edited by thines01: adding code

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.