用C#的IIS上配置用户账号
用C#在IIS上建立站点己经有很多的文章了,不过,对FTP用户的建立不是很多,
- 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();
- }