473,770 Members | 4,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why I can not list the virtual directory?

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(p ath)
Listing.DataSou rce = di.GetFileSyste mInfos()
Listing.DataBin d()
----
Anyone can help me about how to list the virtual directory.

Thanks

David
Nov 19 '05 #1
4 2953
Dim path As String = Server.MapPath( "~") ' or "/" if you want the site root
Listing.DataSou rce = Directory.GetDi rectories(path)
Listing.DataBin d()

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #2
A Virtual Directory is a name not a physical location. The physical location
of your Virtual Directory can be anywhere on your hard drive. So the
physical location of your Virtual Directory isn't always
c:\inetpub\wwwr oot\virtualdire ctoryname

If you need to know the physical directories of all your IIS Virtual
Directories, look at the following registry key:
HKEY_LOCAL_MACH INE\SYSTEM\Cont rolSet001\Servi ces\W3SVC\Param eters\Virtual
Roots

"david" <da***@discussi ons.microsoft.c om> wrote in message
news:F5******** *************** ***********@mic rosoft.com...
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(p ath)
Listing.DataSou rce = di.GetFileSyste mInfos()
Listing.DataBin d()
----
Anyone can help me about how to list the virtual directory.

Thanks

David

Nov 19 '05 #3
In
Dim path As String = Server.MapPath( x),
the x is relative path root. It works for real directory path within wwwroot.

David

"Brock Allen" wrote:
Dim path As String = Server.MapPath( "~") ' or "/" if you want the site root
Listing.DataSou rce = Directory.GetDi rectories(path)
Listing.DataBin d()

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #4
Thank you both of you.
I just created the virtual directory from IIS. If I set the property of
directory browsing, I can directly access to the directory virtually and get
anything I want from IE without my form based authentication. Now I try to
access it programatically without that setting and list the directory tree.
It works for others (not virtual one).

David

"gabe garza" wrote:
A Virtual Directory is a name not a physical location. The physical location
of your Virtual Directory can be anywhere on your hard drive. So the
physical location of your Virtual Directory isn't always
c:\inetpub\wwwr oot\virtualdire ctoryname

If you need to know the physical directories of all your IIS Virtual
Directories, look at the following registry key:
HKEY_LOCAL_MACH INE\SYSTEM\Cont rolSet001\Servi ces\W3SVC\Param eters\Virtual
Roots

"david" <da***@discussi ons.microsoft.c om> wrote in message
news:F5******** *************** ***********@mic rosoft.com...
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(p ath)
Listing.DataSou rce = di.GetFileSyste mInfos()
Listing.DataBin d()
----
Anyone can help me about how to list the virtual directory.

Thanks

David


Nov 19 '05 #5

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

Similar topics

3
13360
by: Zenobia | last post by:
I copy an application to wwwroot: wwwroot +--- myApp +--- common | +--- images | default.asp global.asa
2
4231
by: Jeffry van de Vuurst | last post by:
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of you has some ideas about this. I'm using the NetAdvantage component suite from Infragistics for my web applications. When installing they create several virtual
5
3669
by: Leszek | last post by:
Hello, Could anybody explain what's a difference between a virtual directory and an application root under IIS? I'm a little bit confused. This is mu problem: Let's assume the following directory structure: FileManager (application name a.k.a. virtual directory?)
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...
2
2793
by: Danny Miller | last post by:
Hi there, I'm facing a problem that is driving me nuts. The scenario is as follows: 1) Create an empty directory structure e.g. C:\Dev1\TestWebApp 2) Map a virtual directory e.g. TestWebApp to this new directory 3) Under C:\Dev1 create a blank visual studio solution and add a new web project called TestWebApp (which will be created in C:\Dev1\TestWebApp and
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.
6
4349
by: ManagedCoder | last post by:
Hi, My requirement is as follows: I need to set the HttpExpires (enable content expiration - set to 7 days) on a folder within a virtual directory. I have been able to set the HttpExpires property on a virtual directory using the following code: DirectoryEntry myVdPath = new
5
7280
by: Ned White | last post by:
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; *******************
6
3531
by: Scott M. | last post by:
I didn't get a resolution to this in my earlier post, so I'll try again: System: Windows XP Pro. (SP2) with IIS installed and running PRIOR to VS 2008 Pro. installation. VS 2008 Pro. (full installation). Installations and testing is all done via an Administrator account. If I simply create a new ASP .NET Web Application Project (WAP) on my local
0
9595
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
9432
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
10232
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
10059
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...
0
9873
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
8891
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
7420
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...
1
3974
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
2822
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.