毕业论文

打赏
当前位置: 毕业论文 > 计算机论文 >

C#的FTP服务器软件系统的设计与实现(10)

时间:2017-04-28 09:26来源:毕业论文
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 Pe


            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#的FTP服务器软件系统的设计与实现(10):http://www.youerw.com/jisuanji/lunwen_5865.html
------分隔线----------------------------
推荐内容