473,625 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get folder-path from file-path

I don't find .net lib method to return the folder-path of a file-path.

I'm probably not looking hard enough ... I've checked the
System.IO.File, Path,Directory libs
Oct 28 '08 #1
5 9125
On Tue, 28 Oct 2008 12:16:59 -0700, John A Grandy
<johnagrandy-at-gmail-dot-comwrote:
I don't find .net lib method to return the folder-path of a file-path.

I'm probably not looking hard enough ... I've checked the
System.IO.File, Path,Directory libs
Well, either you simply missed the relevant method on the Path class
(GetDirectoryNa me()), or your question doesn't mean what it looks like it
means. :)
Oct 28 '08 #2
On Tue, 28 Oct 2008 12:16:59 -0700, "John A Grandy"
<johnagrandy-at-gmail-dot-comwrote:
>I don't find .net lib method to return the folder-path of a file-path.

I'm probably not looking hard enough ... I've checked the
System.IO.File ,Path,Directory libs
Look at the FileInfo class.
Oct 28 '08 #3
its easier to use the Path members,
Carlos.

"Joe Cool" <jo*****@home.n etwrote in message news:4t******** *************** *********@4ax.c om...
On Tue, 28 Oct 2008 12:16:59 -0700, "John A Grandy"
<johnagrandy-at-gmail-dot-comwrote:
I don't find .net lib method to return the folder-path of a file-path.

I'm probably not looking hard enough ... I've checked the
System.IO.File, Path,Directory libs

Look at the FileInfo class.

Oct 29 '08 #4
On Wed, 29 Oct 2008 07:28:51 -0300, "xcal" <a@a.comwrote :
>its easier to use the Path members,
Path members?
Carlos.

"Joe Cool" <jo*****@home.n etwrote in message news:4t******** *************** *********@4ax.c om...
>On Tue, 28 Oct 2008 12:16:59 -0700, "John A Grandy"
<johnagrandy-at-gmail-dot-comwrote:
>I don't find .net lib method to return the folder-path of a file-path.

I'm probably not looking hard enough ... I've checked the
System.IO.File ,Path,Directory libs

Look at the FileInfo class.
Oct 29 '08 #5
System.IO

Path.GetFileNam e();
Path.GetDirecto ryName();
Path.GetExtensi on();

etc, etc,

"Joe Cool" <jo*****@home.n etwrote in message news:28******** *************** *********@4ax.c om...
On Wed, 29 Oct 2008 07:28:51 -0300, "xcal" <a@a.comwrote :
its easier to use the Path members,

Path members?
Carlos.

"Joe Cool" <jo*****@home.n etwrote in message
news:4t******** *************** *********@4ax.c om...
On Tue, 28 Oct 2008 12:16:59 -0700, "John A Grandy"
<johnagrandy-at-gmail-dot-comwrote:

I don't find .net lib method to return the folder-path of a file-path.

I'm probably not looking hard enough ... I've checked the
System.IO.File, Path,Directory libs


Look at the FileInfo class.

Oct 30 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1856
by: Craig Keightley | last post by:
I am trying to write a function to copy an existing folder and folder structure but am already stuck. What I want to do is the following: Copy a default folder (default_folder) and all sub folders within it (down to a possible 4 levels) eg default folder ->subfolder1 ->subfolder2
0
3305
by: John H. | last post by:
In effort to understand (Outlook) MAPI folder tree structure wrote simple linear code below to navigate tree. Successive "...Folders.GetNext()"'s return same folder at all levels of tree. What am I doing wrong or not understanding? Thanks.
4
3134
by: Dave Veeneman | last post by:
I'm puzzling over the best design for a Folder object. I have two basic domain objects; leat's call them an Apple and an Orange. The objects are maintained in separate hierarchies, and each hierarchy is organized by Folder objects. A Folder object can contain either Apples, or Oranges, or other Folders. A Folder contains only one type of object. For example, a Folder won't contain Apples and other Folders, or Apples and Oranges. ...
4
1505
by: mike | last post by:
i wonder if bin folder still use in asp.net 2.0 when i migration website for 1.1 how sholud i do? i guess complier would make 2 dll another folder one is bin folder and the other is window/....precomplie.... which one is used by complier?
5
9129
by: Richard J Foster | last post by:
Hi there, I have a pair of C# projects in VS2003. The first project, a dll, is referenced in the second via a project reference. The assemblies in question are delay-signed during a "production" build process, but not as part of a normal development build. I have noticed that while the correctly signed assembly is present in the designated output folder for the project (e.g. bin/Release), an
4
6726
by: Zeb | last post by:
Hi I'm using DirectoryInfo.Delete so that when a product is removed, all it's associated images (including the folder they sit in) are deleted. This actually seems to work fine. However, the folder is not deleted, but stays and becomes totally locked down. I can no longer open it in Windows Explorer and when I try to re-launch VS 2005 debug, it complains because it can no longer monitor that folder .. because it's denied access.
0
1372
by: 1333 | last post by:
I need to create a new folder every time the upload folder has 10 files uploaded to it. So when folder1 has 10 files, folder2 is created and becomes the upload folder, and when it has 10 files uploaded to it folder3 is created and so on..... Problem is that my code creates all the next folders all at once. I need it to create the next folder when it is required. i.e. when the previous folder has reached 10 files. If anyone can explain...
24
7540
by: biganthony via AccessMonster.com | last post by:
Hi, I have the following code to select a folder and then delete it. I keep getting a Path/File error on the line that deletes the actual folder. The line before that line deletes the files in the folder but I get the error message when the procedure attempts to delete the folder selected in the BrowseforFolderbyPath function. How can I get it to delete the folder that the user has selected in the Browse for Folder dialog?
1
3800
by: =?Utf-8?B?d2lubGlu?= | last post by:
Hello 1)When using VS 2005 and VB.net when wouldn't the: reference folder, bin folder, obj folder not be present after creating a VB net Windows Application and only the form1.vb and MyProject folders only be created? 2)How can you assure that the reference folder, bin folder,obj folders get created when the Windows Application is created or atleast how can you add them to the project if they are not created when the Windows...
2
1775
by: swethak | last post by:
hi, i want to copy the contents of one folder into another folder.For that i create the one new folder . I copied the files of already existing folder into new folder.For that i write a code as <?php mkdir("filesscreate",0777); copy('admin','filescreate'); ?>
0
8251
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
8182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8688
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...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
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
7178
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...
0
4085
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...
0
4188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2614
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.