- private static void createftp(string username, string path)
- {
- DirectoryEntry entry = new DirectoryEntry("IIS://localhost/MSFTPSVC/1/Root");
- entry.RefreshCache();
- DirectoryEntry entry2 = entry.Children.Add(username, "IIsFtpVirtualDir");
- entry2.Properties["path"].Insert(0, path);
- entry2.Properties["AccessFlags"].Value = "3";
- entry2.CommitChanges();
- entry.CommitChanges();
- entry2.Close();
- }