473,320 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 9848
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Homer Blankenship | last post by:
Every day we get several errors like or similar to this one while a ..net app is trying to write files to a network share. The .net app breaks the files up into chunks and writes them to this share...
0
by: JP | last post by:
Is there a way to acess .NEt web projects though UNC path (aka network path)? Heres the situation: 1. Dont want to use FP Extentions 2. Can get a web project to open using //IP of server/site...
1
by: Austin Jan | last post by:
Hi all, In this code snip try { using(OpenFileDialog dlg = new OpenFileDialog()) { //do something }
4
by: Rajeev | last post by:
Hi I have developed a windows service using C#. I am checking a folder path using "DirectoryInfo" class which is in local network. It always returns false, even folder exists on local network. ...
8
by: ..:: Kevin ::.. | last post by:
If I load a PictureBox image from an embedded resource within my application it works fine but if I load the same image from a file using OpenFileDialog (as an ImageStream or using the file name)...
3
by: jason | last post by:
I've been playing around with new (for 2.0) membershp functionality. I was able to build a simple login form that secures a directory on a project I built locally on my development desktop. ...
1
by: DKn | last post by:
Hi, How to get the Files from Remote system by using OpenFileDialog control in C#.Net windows application? Actually i am trying to do Software upgradation for a remote system by using...
3
by: jaleel | last post by:
Hi , I want to upload some files to a remote machine frequently.We have an ftp .But I cannot use FTP for uploading file as ftp is not available from remote server. I planned to write an application...
2
by: vickyvick | last post by:
Hi, I'm new to C# and I'm developeing a utility which creates a text file and populates it with registry key values. It works fine on a local path, but with absolute path, it throws an error...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.