473,418 Members | 2,171 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,418 software developers and data experts.

Create FTP Server & Virtual directory

After looking all the ways to progrrammatically create a new FTP Server &
Virtual Directory, I have come to see that the code below is the cleanest.
Here is my basic issue. When I run this code, I successfully create a new
FTP Server and virtual directory. The strange this is that the description
of the new server is (Stopped) and the status has the following warning "The
specified metadata was not found.". If I manually Stop the individual
server and restart it, it comes back clean and all is well. No matter what
I do, I cannot get it to create successfully in a Running state. This exact
same code, except for the different properties, works for creating a new Web
Site and does so without complaint. All of this is on a Windows 2003 server
using .NET v1.1 completely packed and up to date. The physical path exists
and it is not permissions.

Any help or insight would be greatly appreciated!

private void CreateFTP()
{
DirectoryEntry root = new DirectoryEntry("IIS://localhost/MSFTPSVC");
// Create web site
Random r = new Random();
int siteID = r.Next(100000000, 1000000000);
DirectoryEntry site = (DirectoryEntry)root.Invoke("Create",
"IIsFtpServer", Convert.ToString(siteID));
site.Invoke("Put", "ServerComment", "test.com");
site.Invoke("Put", "ServerBindings", "64.16.143.2:21:");
site.Invoke("SetInfo");

// Create virtual directory
DirectoryEntry siteVDir = site.Children.Add("ROOT", "IISFtpVirtualDir");
siteVDir.Properties["Path"][0] = "d:\\internet2\\www\\test";
siteVDir.CommitChanges();
site.CommitChanges();
}

Thx in Advance - Jamie
Nov 17 '05 #1
0 2514

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

Similar topics

5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
3
by: Smitha Nataraj | last post by:
Hello, I need to create a Virtual Directory in C#. Pls let me know if you have any hints regarding this.. Thanks, Smitha
0
by: CM | last post by:
Hi there: I have a web project which can be open and run without problem. I didn't open the web application for a period and during which I didn't modified any IIS items, but now I cannot open any...
4
by: CM | last post by:
Hi there: I have a web project which can be open and run without problem. I didn't open the web application for a period and during which I didn't modified any IIS items, but now I cannot open any...
2
by: Mickey | last post by:
When I try to create a new web application in VS Studio .NET 2003 at a simple default location eg: http://localhost/WebApplication1 I get the following error: Visual Studio .NET cannot create or...
1
by: Stephane | last post by:
Hi, I'm trying to create a virtual directory dynamically in my web site using ASP.NET. I received this error: System.Runtime.InteropServices.COMException (0x800700B7): Cannot create a file...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
1
by: kplkumar | last post by:
Hi I am new to this. I am trying to create a setup project to package our stuff and create an installer. This is what I want to do, I have a directory sructure in which we have our...
5
by: ljlevend2 | last post by:
Is there any way to create a local server during runtime? For example, if you add an existing Web Site to a Solution from within Visual Studio (by right clicking the solution in the Solution...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...
0
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...

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.