hi
i'm developing a program that i need to save some pdf files in the my application's root folder, in winforms i cant find any good sample for save a file in a specified folder (place in the application) .
most of them was about connect to a server on the internet or about browse folder but they don't good for me
then my questions are:
1. how can i upload a pdf file in my application root
2. i have a combobox in my program that bind it's data from database
when i select one of it's item and click on the search button, it shows all pdf files that are relative to my selected item
but when i use it one time, it don't load other it's items anywhere,
it means when i select an item and click on the button, combobox remind on the my selected item and there isn't another items in it!!!
it seams that other items' lose!
any suggestion?
thanks in advance
Loading
Zuber KaziPosted Jan 10, 2012, 7:10 AM
For saving files in root folder take a opendialogbox
then do the following steps
private void btnBrowse_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
tempFolder = root folder path + filename.pdf;//the filename and root folder have to set by you
System.IO.File.Copy(openFileDialog1.FileName, tempFolder); // this copy the selected file to the tempfolder
messagebox.show("file added successfully");
}
}
regards,
Zuber Kazi
Mamta MPosted Jan 10, 2012, 12:23 AM
Windows forms doesnt support fileupload control.
Refer to the following link for some 3rd party control providers. Maybe you will find what you need.
http://msdn.microsoft.com/en-us/vstudio/dd632929
Your second question is not very clear. Can you elaborate?