-
Apr 27th, 2007, 03:02 AM
#41
Re: Create Virtual Directory in IIS using VB.NET
Just loop through all the props out output the name.
woof
-
Apr 27th, 2007, 04:05 AM
#42
New Member
Re: Create Virtual Directory in IIS using VB.NET
I'm a little new to VB.NET.
The properties collection is of type PropertyCollection.
What's the type of each of the elements (the one to use in the for each loop)?
-
Apr 27th, 2007, 10:53 AM
#43
New Member
Re: Create Virtual Directory in IIS using VB.NET
I think this will give you what you need.
link
Thanks for the code. It was exactly what I was looking for.
Last edited by RobM; Apr 27th, 2007 at 10:56 AM.
-
Jul 27th, 2007, 05:39 AM
#44
New Member
Re: Create Virtual Directory in IIS using VB.NET
i dopied source code for creating virtual directory in IIS of local server . but if i want to Create in IIS of another PC using IP adderess ,what should i change in that code??? anyone plssss i m new user ...
-
Jul 27th, 2007, 07:05 AM
#45
New Member
Re: Create Virtual Directory in IIS using VB.NET
Instead of LocalHost pass the IP address.
-
Aug 1st, 2007, 02:09 AM
#46
New Member
Re: Create Virtual Directory in IIS using VB.NET
hi,i can create virtual directory in IIS .but i want to create a New website i.e.www.testing.com. how can i create using vb.net any idea plz plz tell me.....
thanx in Advance
-
Aug 1st, 2007, 04:12 AM
#47
Re: Create Virtual Directory in IIS using VB.NET
-
Aug 2nd, 2007, 01:18 AM
#48
New Member
Re: Create Virtual Directory in IIS using VB.NET
thanks woka.
i want ur suggestion.
what should i use in my project .
MYSQL or microsoft's SQL server as backend in .NET????
if i want to use MYSQL as backend which technology should i prefer?
apache/PHP or .NET??
-
Aug 2nd, 2007, 05:11 AM
#49
Re: Create Virtual Directory in IIS using VB.NET
I would have to always say IIS, .NET and MS SQL Svr.
-
Aug 2nd, 2007, 05:12 AM
#50
Re: Create Virtual Directory in IIS using VB.NET
...then again...it completely depends on what project you are writting. MS SQL Svr my be complete overkill for very very small projects.
Woka
-
Aug 3rd, 2007, 03:59 AM
#51
New Member
Re: Create Virtual Directory in IIS using VB.NET
hi, woka
i m creating job searching website.
jobseekers can resume their CV,search for vaccancies..etc..etc..
it is very big Project..
if i use My SQL as a backend ,will it create any problem(i.e.like speed slow,efficiency etc.)??
i don't want to use MS SQL Server as a backend.
-
Aug 3rd, 2007, 06:02 AM
#52
Re: Create Virtual Directory in IIS using VB.NET
I am not that familiar with My SQL I am afraid.
Why don't you want to use SQL Svr?
Woka
-
Aug 3rd, 2007, 07:02 AM
#53
New Member
Re: Create Virtual Directory in IIS using VB.NET
hi, woka
i m working on the project as per the client requirement. my client wants to use my sql as a backend. do u have any idea plssss??
-
Aug 3rd, 2007, 07:26 AM
#54
Re: Create Virtual Directory in IIS using VB.NET
Ideas on what?
If your client wants My SQL then use My SQL...I wudn't. I would use SQL Svr...MSDE 2000 or MSDE 2005 Express.
My SQL won't cause you any issues I don't think, it's just not as good as SQL Server.
You want to be asking these kind of questions in the DB section...you'll get a bigger response.
Woka
-
Aug 29th, 2007, 11:25 AM
#55
New Member
Re: Create Virtual Directory in IIS using VB.NET
Hi Chaps,
I'm new to this site and registered purely on the back of this excellent piece of work to create virtual directories in VB.NET.
But, I'm having a problem with the RPC issue.
I can't just turn the firewall off (company policy I'm afraid! ).
Is there any further developments with getting round this RPC issue? Are there any exceptions I should set within Windows Firewall to allow this IIS change from the application I've created?
For further information, the error I receive is this:-
System.Runtime.InteropServices.COMExeption occured in system.directoryservices.dll
Additional information: The RPC server is unavailable.
This occurs on the following line within the code:
Dim CanCreate as Boolean = Not IISSchema.Properties("Syntax").Value.ToString.ToUpper() = "Boolean"
Any help would be really appreciated!
Thanks
-
Aug 30th, 2007, 04:57 AM
#56
Re: Create Virtual Directory in IIS using VB.NET
Hi and welcome 
This is a tricky one. It can be caused by many many things. Firewalls just being one of them
Does your company use a 3rd party firewall? If so, turning off the windows firewall may fix the issue.
Not exactly sure what ports need to be open I am afraid 
If you run this on the web server itself do you get the errors?
Woka
-
Aug 30th, 2007, 07:19 AM
#57
New Member
Re: Create Virtual Directory in IIS using VB.NET
I'm not sure exactly how their firewall is set up. It's quite a big company (British Telecom!!! lol).
I'm writing a system to automate the installation of a web application we have developed. Part of the automation is to manipulate IIS and create the virtual directories.
The script has been ran from the web server itself (i.e. localhost) but still this RPC error is returned.
I will do some investigating myself and if I find a solution I'll post it. I'm not holding my breath though!
Cheers
-
Aug 31st, 2007, 03:43 AM
#58
Re: Create Virtual Directory in IIS using VB.NET
hehe. BT. I was working there not so long ago and they have some of the most locked down environments I have ever seen.
Have you heard of HMC, Hosted Message Collaboration? or MPS, Microsoft Provisioning System?
I did some overview dev training on these products for BT a few months ago.
MPS was designed to provision resources in your environment...any resources.
Have a word with ppl at BT and see if they have heard of HMC....if so, use that 
So, you also got the error on the local IIS box? doesn't sound good.
Does the local IIS box have windows firewall running?
Woka
-
Oct 7th, 2007, 11:49 PM
#59
New Member
Re: Create Virtual Directory in IIS using VB.NET
In order for the App Name to be populated correctly, you have to swap these two lines
VDir.CommitChanges()
VDir.Invoke("AppCreate", 1)
Should be
VDir.Invoke("AppCreate", 1)
VDir.CommitChanges()
If you don't swap the two lines, the AppFriendlyName will appear blank when you look at the properties of your Virtual Directoy.
Other than that, excellent code. Thanks
-
Oct 8th, 2007, 02:20 AM
#60
Re: Create Virtual Directory in IIS using VB.NET
Good bug spot. Thanks
-
Feb 15th, 2008, 11:41 AM
#61
New Member
Re: Create Virtual Directory in IIS using VB.NET
Hi Woka..
I only registered to this site to say thank you for the post. Two years later and it's still working and helping people like me. Thank you to all of you. I rewrite the code in c# but for some reason I couldn't figure out it's not working. So I decided to write it in VB.Net and use it as a DLL, which is working perfectly. Weird isn't it?
---
Sergio
-
Sep 22nd, 2008, 06:21 PM
#62
New Member
Re: Create Virtual Directory in IIS using VB.NET
I was wondering if anyone knows how to add an IIS 6 web site with Host Header?
-
Jul 16th, 2010, 03:49 PM
#63
New Member
Re: Create Virtual Directory in IIS using VB.NET
Hi Woka! Thanks for letting us use the code I really appreciate it. The code seemed to be working when I was running it through visual studios, but after we uploaded onto the server I am getting the RPC unavailable error. I'm not sure what to do to fix this, we checked the firewall and are logging in as administrator so I'm not sure what else can be the problem. Do you have any ideas? Here is the stack trace error that follows:
[COMException (0x800706ba): The RPC server is unavailable.
]
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +377678
System.DirectoryServices.DirectoryEntry.Bind() +36
System.DirectoryServices.DirectoryEntry.get_AdsObject() +31
System.DirectoryServices.PropertyValueCollection.PopulateList() +26
System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) +49
System.DirectoryServices.PropertyCollection.get_Item(String propertyName) +150
MFC.WebApp.SecureAuth.WebAdminWorkflow.CreateVirtualDir(String WebSite, String AppName, String Path) +192
MFC.WebApp.SecureAuth.WebAdminWorkflow.AddInstanceButton_Click(Object sender, EventArgs e) +239
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
-
Jul 16th, 2010, 05:23 PM
#64
New Member
Re: Create Virtual Directory in IIS using VB.NET
Nevermind I found what was wrong. I was hardcoding the name for my box while I was coding instead of putting the localhost name. Everything seems to be working fine now
-
Mar 22nd, 2012, 03:44 PM
#65
New Member
Re: Create Virtual Directory in IIS using VB.NET
Hi mate
I dont know how old is this post. the code you wrote is great and works for me like charm the only problem is that i want to add the physical path credentials to the virtual directory with your code but i couldnt find anywhere what property should i use.
greatest regards
Last edited by tarzan_055; Mar 23rd, 2012 at 03:45 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|