473,883 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieve IIS Applicaton Path

I need to routine that will return what 'Request.Applic ationPath' would return in asp.net.

If you are not familiar with that, I just need to know the IIS virtual directory the application is running in, relative to the server root.

I've looked through all the server variables, but don't see anything that will help me, without having to do some string parsing (and even then I'd be guessing at the virtual directory).

A return value would look something like this...where "myapp" is the virtual directory
"/webapps/myapp/"

Any help is much appreciated!
--Michael

Jan 12 '07 #1
1 1496
I found an answer,

Function ApplicationPath ()
sApplicationPat h = LCase(Request.S erverVariables( "APPL_MD_PATH") )
ApplicationPath = Split(sApplicat ionPath, "root")(1)
End Function

Call Response.Write( ApplicationPath () & "<br><br>")

"Raterus" <ra*****@hotmai l.comwrote in message news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
I need to routine that will return what 'Request.Applic ationPath' would return in asp.net.

If you are not familiar with that, I just need to know the IIS virtual directory the application is running in, relative to the server root.

I've looked through all the server variables, but don't see anything that will help me, without having to do some string parsing (and even then I'd be guessing at the virtual directory).

A return value would look something like this...where "myapp" is the virtual directory
"/webapps/myapp/"

Any help is much appreciated!
--Michael

Jan 12 '07 #2

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

Similar topics

6
13275
by: JuLiE Dxer | last post by:
Is there a way via C# to programmatically retrieve the full path name to folders like "My Documents" ?? I'm seeing examples with the use of Shell32 stuff I believe, SHGetSpecialFolderLocation and I have no knowledge nor experience using such stuff. I've seen some examples pertaining to these special folders but it's all Greek to me and I'm sure somebody here could explain it 100 times quicker
1
6106
by: Jan | last post by:
Hi, What is the easiest way to retrieve the path from a console application? Right now I am using: - System.Reflection.Assembly.GetEntryAssembly().Location to extract the path and filename - path.getfullpath to split path and filename I am almost sure there is an easier way...!?
6
5599
by: David Bowey | last post by:
Hi There! I'm writing a custom HttpHandler to create watermarks on my PNG images of my website. So typically, a PNG image is linked in an ASPX page as follows... <img src="images/test.png" alt="testing" /> So I created an HttpHanlder to handle PNG images, have mapped the PNG extension in the IIS and also added the HttpModule section in the web.config file.
6
9189
by: Allen | last post by:
Hi, I want to retrieve the selected folder and entered file name from the SaveFilsDialog. The user is able to create or selected a different folder during the dialog displayed. If user enters "a/b/c/d" in the "File name:" box, then the SaveFileDialog.FileName will return "Path\a\b\c\d" as the name. Is there any way to just retrieve the selected folder and entered file name form the SaveFiledialog?
13
3446
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end of the form which is submit and cancel. After i have clicked submit, the information is stored directly into my corresponding database table. My problem here is i need to retrieve back the information submitted to display all the data that the...
4
3301
by: Thanh-Nhan Le | last post by:
Hi, Is there any function to retrieve the application's path, path of the exe file (as the property app.path of VB6). thanks Nhan
0
1188
by: NETCODE | last post by:
I am developing an add-in. I need to retrieve the path of .msi file, located in under project properties, from the deployment project (setup). I was able retieve all project properties of all projects (ex: output path of the dll) except Deployment project. I am using "project.ConfigurationManager.ActiveConfiguration.Properties" and "Project.Properties" for retrieving all information. But I am stil could not able to retrieve the path...
10
3705
by: kimiraikkonen | last post by:
Hi, I have an app which has a listbox and when i double click an associated fileS, i want their paths to be added into listbox in my application. This code works good when i try to open a "single" file with my app which works to get commandline arguments to get file paths: Dim cla As String() = Environment.GetCommandLineArgs() If cla.Length 1 Then
3
4875
by: =?Utf-8?B?RGV2b24=?= | last post by:
Is it possible to retrieve a proper/invariant file or directory name using a lowercase full path string without having to resort to a call to GetDirectories()/GetFiles() using the directory/filename as the search string? While Path, FileInfo, and DirectoryInfo all store the path information, they use the path case passed to them, so passing a lowercase path to Path.GetFullPath() will return a lowercase full path. TIA
12
78050
lifeisgreat20009
by: lifeisgreat20009 | last post by:
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please give me some idea where I am going wrong ?? I just want to retrieve data from my emp_mstr table and display it using my JSP file... The table emp_mstr is as follows :- CREATE TABLE EMP_MSTR( EMP_NO VARCHAR(10) PRIMARY KEY, PASSWORD...
0
9933
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
9787
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
11128
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
10838
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
9568
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
7119
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
5794
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
4607
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
2
4212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.