473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Get/Set IIS Information Programmatically?

We have a web application that will be installed as a virtual directory. It will either default to the Default Web Site or allow the choice of the site to which the vir. dir. will be installed, if more than one sites exist on the server.

Now, what I would like to do is set the ASP.NET version to 2.0 if it defaults to an earlier version (more than one instance of the Framework is installed). I would like to be able to do this programmatically and have it function properly in both IIS 5 & 6.

I guess I would need to find it programmatically, by name maybe, then set the version, but I have no idea how to do it. I could create an .exe and would like to do it with VB.NET, I guess. This could then be fired at the tail end of my installation process.

Now, I have another problem. Once this is all said and done, I have an .xml file that holds some settings that needs to be tweaked. The line contains http://<computername>/MySite/Service/etc, etc, etc. If the Vir Dir is installed to the Default Web Site, it seems to work OK edited as such.

If the user chooses to install to another site on the server, I have to correct the <computername> portion in some way. For example, if the other web site functions on port 81, that edit would look like <computername>:81. This seems to work.

My problem comes in if the sites share the same IP address and Port and are differentiated by a Host Header. How would I deal with this programmatically? What would be the best way to get the correct information I need to make this edit correctly?

For this part of my problem, I would like to fire an .exe that or vbscript that would gather this information and either set properties in my installation package or edit an .ini file that is installed. I could then make my edit of the <computername> area by reading the .ini file.

Any help with creating any executables or scripts would be greatly appreciated!!

I need help badly!!
Jan 28 '07 #1
1 6352
I have been able to get the Site ID from a supplied name. From this I can set the ASP.NET version using aspnet_regiis.

I'm also able to grab the ServerBindings property information for the site based on that ID, but I have no idea at this point how to resolve the edit I need to make in my .xml file.
Feb 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike Bennett | last post by:
Does the .NET framework (using VB.NET) support the ability to programmatically STOP a device prior to its removal from the system? I have need to move data from a computer on one network to a...
1
by: Walter L. Williams | last post by:
I have defined my own IntegerRangeAttribute which is used like so: private Int32 iNumBurnInIterations = 2000; At another point I want to get at that information, ie: public Int32...
0
by: Srinivas.Gajula | last post by:
Hai, For Example Below are two storeprocedures one returns resultset and other not, how get this information through programmatically. 1)CREATE PROCEDURE dbo.UpdateCustomers (...
6
by: Null Reference | last post by:
Anybody here who can explain or point me to a link ? I wish to create a blank MS Access DB file programmatically using C# . Thanks, nfs
4
by: BentleyInc | last post by:
I'm trying to find a way to add a whildcard application mapping to aspnet_isapi.dll in IIS programmatically.... been looking into IIS administrator reference but didn't find the right function to...
5
by: Brian McClellan | last post by:
Just wondering if anyone has a simple example of creating a gridview completely programmatically, i'm not doing anything terribly sophisticated. When creating the gridview declaratively evertying...
3
by: Ken Fine | last post by:
I'm interested in programmatically manipulating groups of ASP.NET controls by type. Can someone suggest code for the following? Loop through, say, all label controls on a page, and assigning a...
9
by: Jimmy | last post by:
Well, i know it may be a little non-python thing, however, I can think of no place better to post this question :) can anyone tell me, in python, how to obtain some information of a running...
6
by: Andrew Jocelyn | last post by:
Hi How do I programmatically change (read/write) the values in this app.config file at runtime? Specifically I want to change the client endpoint address but it would be nice to change other...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.