Single post

Create Virtual Directory in IIS [C#/.Net]

If you need to create a Virtual Directory in IIS, this is the resource you’re looking for.

It’s pretty straightforward. If you need to create FTP accounts for users who sign-up for your service, for example, the simplest way would be to:

1) Add a Local Windows User Account or an Active Directory account for the user
2) Create a Virtual Directory in IIS with the SAME username, pointing to the FTP directory

The Virtual Directory is only useful if you’re using IIS’s FTP server. If there is a Virtual Directory named after the person logging in, it directly takes them to their folder. Keep in mind that permissions are still a problem. For example, a user can wander away from their directory into other user directories. This is something you’ll need to work on by adding groups, setting appropriate permissions to users you create, etc.

I am yet to come across a good Windows based FTP server which has a good scripting interface. The ones available are pretty basic. I looked at GlobalScape, RaidenFTP and lots of others. RaidenFTP is comparatively easier to interact with because the settings are mostly in text files. So you have a class to interact with the text files and you have it all. GlobalScape provide a horribly documented COM component.

The Raiden Support Team also sent me some settings for a heavy loaded server. Read more if you want them.

bc.. USE_ACL=0
SHOW_DIR_SIZE=0
LARGE_USER_DB=1
LONGRUN_MODE=1
FORCE_ACTIVE_BIND_PORT=20 <- for compatibility with some routers
USE_PORT20_FOR_PORT_CMD=1

and after you setup your server you have *.ftpd file
USER_MAX=500
USE_MAXUSER_PER_IP=0 <- do not restrict it, otherwise it will overload
your server because users keep hammering your server
USE_DATAPORT_RANGE=1
PORT_FROM=1401
PORT_TO=2400
MSG=0
USE_MEM_DB=1 <- FASTest way , but need to load user db to memory
everytime, otherwise set to 0
(when you have advanced license it is not needed, use odbc instead)

Note that these settings are for the Advanced Edition of RaidenFTPD. I haven’t had the chance to test them out yet. The solution I had to implement works fine for now with IIS FTP Server. More after I check Raiden out.

August 12th, 2004 at 4:55 pm

Looks like your site is going to become a very good c#/.Net resource ;)

mannu
October 4th, 2004 at 11:46 am

mm

December 8th, 2004 at 5:08 pm

very nice resource..i am making an application which will display all websites hosted on IIS ,i want their name in combobox.i am using C#

Thanks

-adnan

nzmike
July 15th, 2005 at 2:04 pm

This is a seriously excellent site – your tips about setting up local users using net.exe have saved me so many headaches setting up isolated FTP for our users to upload their files… thanks!!

LEAVE A COMMENT

theme by teslathemes