470,611 Members | 2,038 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,611 developers. It's quick & easy.

How to get the network path using OpenFileDialog?

Hi,
I'm using the OpenFileDialog to let the user pick a file, then I need to get
the file name and file path of the picked file and store it in a database.
My problem comes in when the user picks files from a network folder. Instead
of getting the real file path, i.e. \\servername\sharedfolder, what I get is
the drive letter of the mapped drive. So, instead of having the true path
like '\\servername\sharedfolder\filename.txt', now I get something like
'M:\filename.txt'.
Is there any way I can get the real file path? If possible, please give me
some sample code.
Thanks in advance for your help.
Nov 21 '05 #1
2 9422
VhD50,

A couple of places to start with:

http://www.codeproject.com/csharp/networkshares.asp

http://www.dotnet247.com/247referenc.../16/82735.aspx

Kerry Moorman
"VhD50" wrote:
Hi,
I'm using the OpenFileDialog to let the user pick a file, then I need to get
the file name and file path of the picked file and store it in a database.
My problem comes in when the user picks files from a network folder. Instead
of getting the real file path, i.e. \\servername\sharedfolder, what I get is
the drive letter of the mapped drive. So, instead of having the true path
like '\\servername\sharedfolder\filename.txt', now I get something like
'M:\filename.txt'.
Is there any way I can get the real file path? If possible, please give me
some sample code.
Thanks in advance for your help.

Nov 21 '05 #2
Hi,

Our product, Dialog Workshop .NET contains special customized Open/Save
dialogs
which allow to extend the functionality of standard .NET Open/Save dialogs.
Our dialogs allow to get full remote folder path like this:

ftp://us******@yoursite.com/yourfolder

Please visit http://www.componentage.com for details.
Also please Dialog Workshop .NET user's manual, "Working with remote
folders" topic.

With Best Regards,
Sergey

"VhD50" <vh****@hotmail.com> wrote in message
news:u7**************@TK2MSFTNGP15.phx.gbl...
Hi,
I'm using the OpenFileDialog to let the user pick a file, then I need to
get the file name and file path of the picked file and store it in a
database.
My problem comes in when the user picks files from a network folder.
Instead of getting the real file path, i.e. \\servername\sharedfolder,
what I get is the drive letter of the mapped drive. So, instead of having
the true path like '\\servername\sharedfolder\filename.txt', now I get
something like 'M:\filename.txt'.
Is there any way I can get the real file path? If possible, please give me
some sample code.
Thanks in advance for your help.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Homer Blankenship | last post: by
1 post views Thread by Austin Jan | last post: by
4 posts views Thread by Rajeev | last post: by
8 posts views Thread by ..:: Kevin ::.. | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.