if (txtPassword.Text.Length < 2) Message += "Password cannot be lesser than 2 chars\n";
if (!System.IO.Directory.Exists(txtStartUpPath.Text)) Message += "The selected root path dose not exists\n";
string PermissionSet = string.Empty;
PermissionSet += (chkAllowStoreFiles.Checked) ? "1" : "0";
PermissionSet += (chkAllowStoreFolders.Checked) ? "1" : "0";
PermissionSet += (chkAllowRenameFiles.Checked) ? "1" : "0";
PermissionSet += (chkAllowRenameFolders.Checked) ? "1" : "0";
PermissionSet += (chkAllowDeleteFiles.Checked) ? "1" : "0";
PermissionSet += (chkAllowDeleteFolders.Checked) ? "1" : "0";
PermissionSet += (chkAllowCopyFiles.Checked) ? "1" : "0";
if (PermissionSet.IndexOf('1') == -1) Message += "The user requires atleast a single permission.\n";
PermissionSet += (chkAllowViewHiddenFiles.Checked) ? "1" : "0";
PermissionSet += (chkAllowViewHiddenFolders.Checked) ? "1" : "0";
if (Message.Length != 0)
{
MessageBox.Show(Message, "Advanced FTP Server");
return;
}//保存添加用户并判断添加信息
if (OldUserName == null) //增加新用户 {
if (!ApplicationSettings.CreateFTPUser(txtUserName.Text, txtPassword.Text, txtStartUpPath.Text, PermissionSet, chkEnableUser.Checked))
{
MessageBox.Show("User with the specified name already exists. Please specify different User Name", "Advanced FTP Server");
return;
}
}
else // 编辑用户
{
if (!ApplicationSettings.EditUser(OldUserName, txtUserName.Text, txtPassword.Text, txtStartUpPath.Text, PermissionSet, chkEnableUser.Checked))
- 上一篇:造币机械生产车间信息管理系统分析与研究
- 下一篇:C#的家庭理财系统软件设计+ER图
-
-
-
-
-
-
-
电站锅炉暖风器设计任务书
河岸冲刷和泥沙淤积的监测国内外研究现状
杂拟谷盗体内共生菌沃尔...
十二层带中心支撑钢结构...
酸性水汽提装置总汽提塔设计+CAD图纸
java+mysql车辆管理系统的设计+源代码
当代大学生慈善意识研究+文献综述
乳业同业并购式全产业链...
大众媒体对公共政策制定的影响
中考体育项目与体育教学合理结合的研究