用C#的IIS上配置用户账号

用C#在IIS上建立站点己经有很多的文章了,不过,对FTP用户的建立不是很多,

  1.         private static void createftp(string username, string path)
  2.         {
  3.             DirectoryEntry entry = new DirectoryEntry("IIS://localhost/MSFTPSVC/1/Root");
  4.             entry.RefreshCache();
  5.             DirectoryEntry entry2 = entry.Children.Add(username, "IIsFtpVirtualDir");
  6.             entry2.Properties["path"].Insert(0, path);
  7.             entry2.Properties["AccessFlags"].Value = "3";
  8.             entry2.CommitChanges();
  9.             entry.CommitChanges();
  10.             entry2.Close();
  11.         }
posted @ 2010-04-11 12:37  与时俱进  阅读(692)  评论(0编辑  收藏  举报
友情链接:同里老宅院民居客栈