473,729 Members | 2,309 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\sh aredfolder, what I get is
the drive letter of the mapped drive. So, instead of having the true path
like '\\servername\s haredfolder\fil ename.txt', now I get something like
'M:\filename.tx t'.
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 9941
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\sh aredfolder, what I get is
the drive letter of the mapped drive. So, instead of having the true path
like '\\servername\s haredfolder\fil ename.txt', now I get something like
'M:\filename.tx t'.
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******** ******@TK2MSFTN GP15.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\sh aredfolder,
what I get is the drive letter of the mapped drive. So, instead of having
the true path like '\\servername\s haredfolder\fil ename.txt', now I get
something like 'M:\filename.tx t'.
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
7405
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 as it recieves the file over the Internet. Sometimes it fails with a Network path not found error like this one and other times it will fail with a No file to append to error after it has written several chunks of data and it's like it just...
0
1680
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 folder name/proj file 3. Does not allow rebuilding of the proj file, says network path //IP of server/site folder name/ does not exist or has been moved, when you click ok, it put the URL of the site in the path box to save.
1
4948
by: Austin Jan | last post by:
Hi all, In this code snip try { using(OpenFileDialog dlg = new OpenFileDialog()) { //do something }
4
11943
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. folderPath = "\\MyServer\IO\XYZ_Folder"; DirectoryInfo di = new DirectoryInfo(folderPath); return di.Exists; //This returns false
8
10333
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) the background color is not masked out. Any ideas?
3
4159
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. However, when I attempt to follow the same steps on the remote test server (a website I access via filesystem security accross my lan ).. I get the following when I attempt to select the security tab from the administer selection of the login...
1
2683
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 Win32_Product. For this i need to give the Patch location by using OpenFileDialog Control.. how to do this... Thanks in advance..
3
2495
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 for that using FileWebResponse class. As a starting point I just tried to access that machine using program. But I am getting an error like the network path not found. FileWebResponse response=null; try { ...
2
23725
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 that "Access to the path .... is deined". Code is given below. StreamWriter SW1; FileIOPermission myPerm = new FileIOPermission(FileIOPermissionAccess.Write, "\\\\192.168.48.125\\Shared"); myPerm.Assert(); //new...
0
8917
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8148
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.