Part II technical difficulties and solutions 1. After technical difficulties analysis of the function of the system, let's take a look at the key technical difficulties: (1) Open the FTP account in real time; (2) Open the virtual site in real time; (3) Online Real-time open Email account; (4) Operation of the IIS / MSSQL / FTP / MAIL system start, stop; other features, other functions are nothing more than simple database entry, query, modification, delete operation, so as long as solving Difficulties, the system implements basic functions. Second, the solution (1) Online Real-Time Opening FTP account: Here, the FTP server-side system we use is the Serv-U version of the SERV-U version, and the user is added, deleted, and modify the user by rewriting the servudaemon.ini file. The following is an original code that increases FTP users: <% '********************************************** ************ '* author: awaysrain (absolute zero) *' * completion time: 2003-10-10 * '* modified: 2005-01-11 *' * test environment: Win2000 Server, Serv-U 6.0Beta version * '**************************************************** ********** DIM INIPATH, INIFILENAME, INISTR, TMPSTR, N DIM UserName, Password, TMP
Username = "myfso222" 'User name Password = "AWAYSRAIN"' password 'tmp = "ai" randomly generates two lowercase letters, (should be randomly generated, but I omitted here)' Password = TMP & UCase (MD5 (password)) 'Password, is the MD5 encrypted, the MD5 encryption program of the MD5, the specific algorithm is randomly generated two lowercase letters, then connects MD5 encryption with your password, put randomly generated password and MD5 encryption The result is stored as a password, and an example, for example, the AwaySrain user below, my password is first randomly generated two lowercase letters AI, and I get AIAWAYSRAIN to get the AIAWAYSRAIN MD5 encryption to get 9118BFD94A9CE9CF37AE5baa947ed596 put random build The result of two lowercase letters AI and MD5 encryption 9118BFD94A9CE9CF37AE5BAA947ED596 connection Get password Ai9118BFD94A9CE9CF37AE5BAA947ED596
Inipath = "D: / Program Files / Serv-U" 'INI file path inIfilename = "servudaemon.ini"' INI file name
Set fso = server.createObject ("scripting.filesystemObject") Set servuini = fso.opentextfile (Inipath & "& INIFILENAME, 1, FALSE)
Inistr = "" n = 0 AddedUserList = false
Set tf = fso.createtextfile (Inipath & "/" & Inifilename & "._Awaysrain.tmp", true) "Generates a new temporary INI file do while not servuini.atendofstream tmpstr = servuini.readline
If INSTR ("AwaySrain ||" & Tmpstr, "Awaysrain || User")> 0 THEN 'Record the number of users from N = N 1 END IF
IF INSTR ("AWAYSRAIN ||" & Tmpstr, "AwaySrain || [User =")> 0 and not addeduserlist the 'Add the current user n = n 1 tf.writeLine ("User" & n & "=" & username & "| 1 | 0") AddedUserList = true endiff servuini.close (TMPSTR) loop servuini.close
'Add new users' information, the specific content can be created in the Serv-U and the Ini file
Tf.writeline ("[user =" & usrname & "| 1]") 'User name Tf.Writeline ("password =" & password)' password TF.writeline ("Homedir = D: / TEMP") 'home directory Tf.writeline ("Relpaths = 1") 'Does the user locked the user in the primary directory Tf.Writeline ("MAXUSERSLOGINPERIP = 1")' The same IP simultaneously logs in Tf.WriteLine ("SpeedLimitdown = 102400") 'Maximum download speed Tf.Writeline ("Timeout = 600") 'Idle Time (Second) Tf.Writeline ("Access1 = D: / Temp | RLP")' Access Directory, may not be one, such as 'Access2 = E: / TEMP1 | RLP'
Tf.Close '-------------------- Backup original INI file ------------------- ----- set f1 = fso.getfile (Inipath & "/" & Inifilename) f1.copy (Inipath & "/" & INIFILENAME & "._Awaysrain.bak") f1.delete '------- ------------ Change the generated temporary INI file to formal ini -------------------------- Set f1 = fso.getfile (Inipath & "/" & INIFILENAME & "._AWAYSRAIN.TMP") f1.copy (Inipath & "/" & INIFILENAME) f1.delete
SET FSO = NOTHING%> Here I have made a certain modification of the original author, and the original encryption of the password, this way, the password in the ini file is directly seen, why do you want this ... because 6.0 And the encryption algorithm of 4.2 is not big (if you have a friend who knows the plus algorithm, please tell me), and we now do the virtual host management system's focus, so I went this part. The settings of the Serv-U here are required to note: 1 must already have a domain, and if there is at least one user, it can be successful. 2 Since the encryption algorithm for the password is removed, the "stored the password in the encrypted form" option in the advanced option in the field. (2) Online Real Time Opening Virtual Site: In order to meet domain name steering function, we ask us to open "virtual site" online, rather than opening "virtual directory", and the directory cannot control steering. I have found some information on the Internet to build a virtual site, but I have failed ... I don't know why, such as "Adsi Modify IIS Information", no, prompt "permission is not enough". Later, some information was found, found that the VBS script under C: / INETPUB / Adminscript implemented the management of IIS, when I was called by ASP, there was a problem that the permissions were insufficient, all change, pass Components call these scripts to control IIS.