473,765 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting list of the files from a virtual directory

I have set up a virtual directory on ISS 6.0 to store the all .jpg and .swf
files which i use in my project
It is alias name is "OutSrc"

Is it possible to acquire a list of files which exist in that virtual
directory ?

For my default project directory, i can get list of the specific files like
that;
*************** ****
DirectoryInfo drc = new DirectoryInfo(" ~/banners");
FileInfo[] FileLst = drc.GetFiles("* .swf");
*************** ****
But, how about for the virtaul directory, Is there a way to do this?

Thanks,
Jun 27 '08 #1
5 7279
You can always convert a virtual path to the physical one with the MapPath
method. After this you can use the same DirectoryInfo calls.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Ned White" <nedwhite@wro te in message
news:u7******** ******@TK2MSFTN GP06.phx.gbl...
>I have set up a virtual directory on ISS 6.0 to store the all .jpg and .swf
files which i use in my project
It is alias name is "OutSrc"

Is it possible to acquire a list of files which exist in that virtual
directory ?

For my default project directory, i can get list of the specific files
like that;
*************** ****
DirectoryInfo drc = new DirectoryInfo(" ~/banners");
FileInfo[] FileLst = drc.GetFiles("* .swf");
*************** ****
But, how about for the virtaul directory, Is there a way to do this?

Thanks,

Jun 27 '08 #2
Hi Eliyahu ,

The physical path of my OutPic virtual directory is "C:\Media\Banne rs" and
if i use
DirectoryInfo sf = new DirectoryInfo(S erver.MapPath(" OutPic"));
It returs "'c:\inetpub\ww wroot\defaultsi te\OutPic"
but the real physical path is "C:\Media\Banne rs" and the virtual path
is"'c:\inetpub\ wwwroot\OutPic"

Sorry bu i don't understand that how can i convert the virtual path to
physical with MapPath ?
Thanks
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:O1******** ******@TK2MSFTN GP06.phx.gbl...
You can always convert a virtual path to the physical one with the MapPath
method. After this you can use the same DirectoryInfo calls.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Ned White" <nedwhite@wro te in message
news:u7******** ******@TK2MSFTN GP06.phx.gbl...
>>I have set up a virtual directory on ISS 6.0 to store the all .jpg and
.swf files which i use in my project
It is alias name is "OutSrc"

Is it possible to acquire a list of files which exist in that virtual
directory ?

For my default project directory, i can get list of the specific files
like that;
************** *****
DirectoryInf o drc = new DirectoryInfo(" ~/banners");
FileInfo[] FileLst = drc.GetFiles("* .swf");
************** *****
But, how about for the virtaul directory, Is there a way to do this?

Thanks,


Jun 27 '08 #3
Is this OutPic or OutSrc as you named it in IIS according to your first post
?

What is the output for Server.MapPath( "~/OutSrc") ?

--
Patrice

"Ned White" <nedwhite@a écrit dans le message de groupe de discussion :
ef************* *@TK2MSFTNGP05. phx.gbl...
Hi Eliyahu ,

The physical path of my OutPic virtual directory is "C:\Media\Banne rs" and
if i use
DirectoryInfo sf = new DirectoryInfo(S erver.MapPath(" OutPic"));
It returs "'c:\inetpub\ww wroot\defaultsi te\OutPic"
but the real physical path is "C:\Media\Banne rs" and the virtual path
is"'c:\inetpub\ wwwroot\OutPic"

Sorry bu i don't understand that how can i convert the virtual path to
physical with MapPath ?
Thanks
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:O1******** ******@TK2MSFTN GP06.phx.gbl...
>You can always convert a virtual path to the physical one with the
MapPath method. After this you can use the same DirectoryInfo calls.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Ned White" <nedwhite@wro te in message
news:u7******* *******@TK2MSFT NGP06.phx.gbl.. .
>>>I have set up a virtual directory on ISS 6.0 to store the all .jpg and
.swf files which i use in my project
It is alias name is "OutSrc"

Is it possible to acquire a list of files which exist in that virtual
directory ?

For my default project directory, i can get list of the specific files
like that;
************* ******
DirectoryIn fo drc = new DirectoryInfo(" ~/banners");
FileInfo[] FileLst = drc.GetFiles("* .swf");
************* ******
But, how about for the virtaul directory, Is there a way to do this?

Thanks,


Jun 27 '08 #4
ohh sory for the mistake,
Yes Patrice, u are right, the "OutPic" is must be "OutSrc" .
the alias name of the virtual directory is "OutSrc" .
output of the Server.MapPath( "~/OutSrc") is
"c:\\inetpub\\w wwroot\\default site\\OutSrc"

"defaultsit e" is the default project site. That's why if i use
Server.MapPath in my project it returns value for the project site, and it
puts
"defaultsit e" before the OutSrc.


"Patrice" <http://www.chez.com/scribe/wrote in message
news:6C******** *************** ***********@mic rosoft.com...
Is this OutPic or OutSrc as you named it in IIS according to your first
post ?

What is the output for Server.MapPath( "~/OutSrc") ?

--
Patrice

"Ned White" <nedwhite@a écrit dans le message de groupe de discussion :
ef************* *@TK2MSFTNGP05. phx.gbl...
>Hi Eliyahu ,

The physical path of my OutPic virtual directory is "C:\Media\Banne rs"
and if i use
DirectoryInf o sf = new DirectoryInfo(S erver.MapPath(" OutPic"));
It returs "'c:\inetpub\ww wroot\defaultsi te\OutPic"
but the real physical path is "C:\Media\Banne rs" and the virtual path
is"'c:\inetpub \wwwroot\OutPic "

Sorry bu i don't understand that how can i convert the virtual path to
physical with MapPath ?
Thanks
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:O1******** ******@TK2MSFTN GP06.phx.gbl...
>>You can always convert a virtual path to the physical one with the
MapPath method. After this you can use the same DirectoryInfo calls.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Ned White" <nedwhite@wro te in message
news:u7****** ********@TK2MSF TNGP06.phx.gbl. ..
I have set up a virtual directory on ISS 6.0 to store the all .jpg and
.swf files which i use in my project
It is alias name is "OutSrc"

Is it possible to acquire a list of files which exist in that virtual
directory ?

For my default project directory, i can get list of the specific files
like that;
************ *******
DirectoryInf o drc = new DirectoryInfo(" ~/banners");
FileInfo[] FileLst = drc.GetFiles("* .swf");
************ *******
But, how about for the virtaul directory, Is there a way to do this?

Thanks,


Jun 27 '08 #5
There is an override of MapPath method for HttpRequest that take 3
parameters:
http://msdn.microsoft.com/en-us/library/3z2189ck.aspx

I have never used it myself, just wondering if you can get any use of it.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Ned White" <nedwhite@wro te in message
news:uu******** *****@TK2MSFTNG P04.phx.gbl...
ohh sory for the mistake,
Yes Patrice, u are right, the "OutPic" is must be "OutSrc" .
the alias name of the virtual directory is "OutSrc" .
output of the Server.MapPath( "~/OutSrc") is
"c:\\inetpub\\w wwroot\\default site\\OutSrc"

"defaultsit e" is the default project site. That's why if i use
Server.MapPath in my project it returns value for the project site, and it
puts
"defaultsit e" before the OutSrc.


"Patrice" <http://www.chez.com/scribe/wrote in message
news:6C******** *************** ***********@mic rosoft.com...
>Is this OutPic or OutSrc as you named it in IIS according to your first
post ?

What is the output for Server.MapPath( "~/OutSrc") ?

--
Patrice

"Ned White" <nedwhite@a écrit dans le message de groupe de discussion :
ef************ **@TK2MSFTNGP05 .phx.gbl...
>>Hi Eliyahu ,

The physical path of my OutPic virtual directory is "C:\Media\Banne rs"
and if i use
DirectoryIn fo sf = new DirectoryInfo(S erver.MapPath(" OutPic"));
It returs "'c:\inetpub\ww wroot\defaultsi te\OutPic"
but the real physical path is "C:\Media\Banne rs" and the virtual path
is"'c:\inetpu b\wwwroot\OutPi c"

Sorry bu i don't understand that how can i convert the virtual path to
physical with MapPath ?
Thanks
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:O1******** ******@TK2MSFTN GP06.phx.gbl...
You can always convert a virtual path to the physical one with the
MapPath method. After this you can use the same DirectoryInfo calls.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Ned White" <nedwhite@wro te in message
news:u7***** *********@TK2MS FTNGP06.phx.gbl ...
>I have set up a virtual directory on ISS 6.0 to store the all .jpg and
>.swf files which i use in my project
It is alias name is "OutSrc"
>
Is it possible to acquire a list of files which exist in that virtual
directory ?
>
For my default project directory, i can get list of the specific files
like that;
*********** ********
DirectoryIn fo drc = new DirectoryInfo(" ~/banners");
FileInfo[] FileLst = drc.GetFiles("* .swf");
*********** ********
But, how about for the virtaul directory, Is there a way to do this?
>
Thanks,
>



Jun 27 '08 #6

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

Similar topics

3
20994
by: Harold Crump | last post by:
Greetings, I need to get a list of all files in a particular virtual directory on a web site, such as - http://www.myServer.com/FileStore I tried using the directory functions, but this doesn't work. if($dirHandle = opendir("http://www.myServer.com/FileStore/")) {
6
2200
by: Peter Row | last post by:
Hi, Can someone give me a set of steps for an ASP.NET project (well actually its just a VB.NET class DLL that implements HttpHandler) that will work when moved to another developers machine? Here are some specifics: 1) The code, project/solution files are in MS Visual Source Safe
1
1491
by: Craig Burkett | last post by:
I have set up a virtual directory using IIS which points to a share on another machine. I want to be able to acquire a list of folders and/or files which exist in that share via the virtual directory (I can't just map the file to a harddrive). Is there a way to do this? Maybe it would just be easier to use a UNC name, but if I go this route how do I pass the necessary credentials to establish a connection to the share without mounting...
1
2082
by: Michał Januszczyk | last post by:
How can I retrieve web application name (or virtual dir name)? (Actually I need physical root directory of web application) I want to open some files in web application root relative directory. Previously I used to open the files when client connected and thus could use the following code to retreive physical file location: string webAppRootDir = Server.MapPath(Request.ApplicationPath);
4
7575
by: Jerry | last post by:
I'm having just a bit of trouble wrapping my brain around the task of working with folders that are above the site's root folder. I let users upload photos (.jpg/.gif files) which can subsequently be viewed on the site's pages. My hosting provider is requiring that any files my Web app writes get written to a folder that is above the app's root folder (for security purposes). When writing the files I understand how to use MapPath to...
4
2953
by: david | last post by:
I basically use the following code to display the directory and file names in the WWWROOT, but can not show the virtual directory. ---- Dim path As String = Server.MapPath(x) Dim di As DirectoryInfo = New DirectoryInfo(path) Listing.DataSource = di.GetFileSystemInfos() Listing.DataBind() ---- Anyone can help me about how to list the virtual directory.
2
5388
by: Lucky | last post by:
Hello Guys, after long long time. i'm back again with some questions. right now i'm developing a code that fetch the list of websites from IIS 5.0 or later and also cretes the Virtual Directory for a website in IIS 5.0 or later. interesting thing is i don't know how to do it. i tried to find out namespace or library in VS.NET 2.0, if there is any, but i failed to found one.
13
2812
by: lawpoop | last post by:
Hello all - I have a two part question. First of all, I have a website under /home/user/www/. The index.php and all the other website pages are under /home/user/www/. For functions that are used in multiple files, I have php files under / home/user/www/functions/. These files simply have So, in index.php and other files, I have
11
1436
by: Sachin Garg | last post by:
I need to build two executables from my code, one having all the code (and thus application features) and other not having it all. How to best manage the code that shouldn't go in one of the executables? My first thought is to use conditional compilation with #define and #ifdef etc but its getting messy, are there better ways to manage this? The problem in detail: #. There is a class A with virtual foo1 and foo2
0
9568
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
9398
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,...
1
9951
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
9832
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
8831
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
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
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...
1
3924
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
3
2805
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.