Hi,
If I have a File("c:\test\subdir\file1.html"), what's the best way to get
the directory of this file, ie 'c:\test\subdir'? Thanks! 6 2531
MessageBox.Show(System.IO.Path.GetDirectoryName("c :\\test\\subdir\\file1.html").ToString());
SoxFan44 wrote:
Hi,
If I have a File("c:\test\subdir\file1.html"), what's the best way to get
the directory of this file, ie 'c:\test\subdir'? Thanks!
System.IO.FileInfo fi = new
System.IO.FileInfo(@"c:\test\subdir\file1.html");
Response.Write(fi.DirectoryName);
On Oct 11, 6:59 pm, "SoxFan44" <sox...@44.netwrote:
Hi,
If I have a File("c:\test\subdir\file1.html"), what's the best way to get
the directory of this file, ie 'c:\test\subdir'? Thanks!
Thanks :)
"ergintiravoglu" <er************@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
MessageBox.Show(System.IO.Path.GetDirectoryName("c :\\test\\subdir\\file1.html").ToString());
SoxFan44 wrote:
>Hi, If I have a File("c:\test\subdir\file1.html"), what's the best way to get the directory of this file, ie 'c:\test\subdir'? Thanks!
i think, it is long way, is it?
Deepak Khanal wrote:
System.IO.FileInfo fi = new
System.IO.FileInfo(@"c:\test\subdir\file1.html");
Response.Write(fi.DirectoryName);
On Oct 11, 6:59 pm, "SoxFan44" <sox...@44.netwrote:
Hi,
If I have a File("c:\test\subdir\file1.html"), what's the best way to get
the directory of this file, ie 'c:\test\subdir'? Thanks!
not at all ::))
SoxFan44 wrote:
Thanks :)
"ergintiravoglu" <er************@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
MessageBox.Show(System.IO.Path.GetDirectoryName("c :\\test\\subdir\\file1.html").ToString());
SoxFan44 wrote:
Hi,
If I have a File("c:\test\subdir\file1.html"), what's the best way to get
the directory of this file, ie 'c:\test\subdir'? Thanks!
Hi,
there is no way that you can have a File(....) , File does not have a
constructor as all the methods are static
if you have a File.Open( ... ) you will get a FileStream which has a Name
property. Then you can use System.IO.Path.GetDirectoryName to get the name
of the directory
--
Ignacio Machin
machin AT laceupsolutions.com
"SoxFan44" <so****@44.netwrote in message
news:e$**************@TK2MSFTNGP04.phx.gbl...
Hi,
If I have a File("c:\test\subdir\file1.html"), what's the best way to get
the directory of this file, ie 'c:\test\subdir'? Thanks! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Morten Overgaard |
last post by:
Hi all
Is it possible for a .Net app. to intercept the "open" action on files in a
given directory.
I want to intercept the "open" action and the perhaps direct the client (
the app. which is...
|
by: Pablo |
last post by:
Hi,
I'm creating an AppDomain and creating an instance of a class. This works
fine unless I use caching, which I need to use.
The exception that I get is of type "System.IO.FileLoadException"...
|
by: Jack David |
last post by:
Using the code below I am able to monitor a single directory for a new file
and then kick-off a process to deal with the file. The question is??? How
would I modify this code to be able to monitor...
|
by: raj |
last post by:
I want to create a new directory in a given path and need to create a file in
that new directory. Any ideas?
|
by: Elmo Watson |
last post by:
Is there a way, with the System.IO class, to do a recursive list of a
directory structure?
For instance, in DirectoryInfo, you have GetDirectories and GetFiles ....
In Directory, you have...
|
by: GeorgeB |
last post by:
I have built a solution in vb.net with 2 projects the project with the class
libraries and the project which consumes them.
The class library project references some other libraries(Different Class...
|
by: Nurit N |
last post by:
This is the third newsgroup that I'm posting my problem.
I'm sorry for the multiple posts but the matter becoming urgent.
I hope this is the right place for it...
I have created a very...
|
by: Timothy |
last post by:
Hi All,
Please everyone this is my humble request to all of you if you please
have idea about my question then please help me with your master
ideas.
I have requirement that i should either have...
|
by: gunjan29484 |
last post by:
Hello,
i want to compare the two directory structures and find out if any file or directory is missing in the second directory structure or not.
(directory1 is a super set of directory2)
I have...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
| |