Click here to Skip to main content
15,891,739 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to take files from my server. The path has created in application (in my local system) connecting in LAN, like @"...........\" how it is possible?

please help me sir...
C#
SaveFileDialog sfdBackUpPath = new SaveFileDialog();
sfdBackUpPath.Title = "Select File To Upload";
sfdBackUpPath.InitialDirectory = @"server2\";
DateTime DT = DateTime.Today;
sfdBackUpPath.FileName = "FAMS_" + DT.ToString("yyyyMMdd");
sfdBackUpPath.Filter = "BAK files (*.*)|*.bak";
sfdBackUpPath.FilterIndex = 1;
sfdBackUpPath.RestoreDirectory = true;
if (sfdBackUpPath.ShowDialog() == DialogResult.OK)
{
       if (sfdBackUpPath.FileName != "")
       {
            int index = sfdBackUpPath.FileName.IndexOf(".bak");
            this.txtFile.Text = sfdBackUpPath.FileName.Remove(index, 4);
       }
}
Posted
Updated 7-May-12 0:56am
v3
Comments
OriginalGriff 7-May-12 5:43am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
Dhanamanikandan 7-May-12 5:50am    
Please elaborate the question to help you!
bbirajdar 7-May-12 10:12am    
Reason for my vote of 1
Unclear

1 solution

You want to browse the file system of your server from an application? You can do it, but it depends on the server, and the access you have to it. Theoretically you can use UNC paths like @"\\servername\c$\Windows" for admin shares or @"\\servername\sharename" for normal shares... but only if they are windows servers or you have samba on it, and you have the right to browse. With other protocols you might have other extras to keep in mind. You can even browse file lists over http, ftp, webdav, or other registered protocol handlers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900