Use the program to automatically establish an FTP account (SERV-U ODBC setting)
Steps: 1. Create a database (you can use any database SQL Server, Access) 2, establish DNS3, install the Serv-U4, create a domain 5, complete. Ha ha ~! SERV-U Build 6.0.0.1 version
★ Serv-U FTP Server 6.0.0.1 Final
Very good FTP server software, it is simple to set, powerful, and stable performance. You can now build your own FTP server.
Hanhua instructions:
1. Please install the original English software first. 2, exit the FTP Serv-U application! Including the system bar icon! 3. After decompression, run the Chinese package and fill in your installation directory for Chinese. 4, other cracked patch in the Chinese package: Serv-U6001cr.exe, if necessary, you can crack itself, crack, before the SERVUDAEMON.EXE process in the system, or stop the Serv-U service. Then copy the crack file to the SERV-U installation directory for crack. After cracking, the "Enterprise Edition" that has never expired. If you have used the previous crack version, you may report that you can steal the registration code. At this time, please select "Delete Key" in Local Server - License. . 5, some original English version of users may lead to loss, which may be due to the difference between Chinese resources and English version, can only re-set up. There is no such problem before using the Chinese version. 6. If you have used my Chinese patch, please use the new Chinese patch after deleting the old "Hanhua .txt" file.
Establish a database of SQL:
/ ****** Object: Database Host Script date: 2004-12-24 13:16:31 ****** / if EXISTS (Select Name from master.dbo.sysdatabases where name = n'Host ') DROP DATABASE [HOST] GO
Create Database [host] on (name = n'Host_data ', filename = n'd: /wwwroot/host/database/host.mdf', size = 2, filegrowth = 10%) log on (Name = n'Host_log ' , Filename = n'd: /wwwroot/host/database/host_log.ldf ', size = 9, filegrowth = 10%) Collate Chinese_prc_ci_ASGO
EXEC SP_DBOPTION N'HOST ', N'AUTOCLOSE', N'FALSe'go
EXEC SP_DBOPTION N'HOST ', N'BULKCOPY', N'FALSE'GO
EXEC SP_DBOPTION N'HOST ', N'TRUNC. LOG', N'FALSE'GO
EXEC SP_DBOPTION N'HOST ', N'TORN PAGE Detection', N'true'go
EXEC SP_DBOPTION N'HOST ', N'READ ONLY', N'FALSE'go
EXEC SP_DBOPTION N'HOST ', N'DBO USE', N'FALSE'goexec sp_dboption n'Host ', N'single', N'False'go
EXEC SP_DBOPTION N'HOST ', N'AUTOSHRINK', N'FALSE'GO
EXEC SP_DBOPTION N'HOST ', N'SI Null Default', N'False'go
EXEC SP_DBOPTION N'HOST ', N'Recursive Triggers', N'False'go
EXEC SP_DBOPTION N'HOST ', N'si Nulls', N'False'go
EXEC SP_DBOPTION N'HOST ', N'CONCAT NULL YIELDS NULL', N'FALSE'go
EXEC SP_DBOPTION N'HOST ', N'CURSOR Close on Commit', N'False'go
EXEC SP_DBOPTION N'HOST ', N'DEFAULT to LOCAL CURSOR', N'FALSE'GO
EXEC SP_DBOPTION N'HOST ', N'QUOTED Identifier', N'false'go
EXEC SP_DBOPTION N'HOST ', N'si Warnings', N'False'go
EXEC SP_DBOPTION N'HOST ', N'AUTO CREATE STATISTISTIS', N'TRUE'GO
EXEC SP_DBOPTION N'HOST ', N'AUTO UPDATE STATISTICS', N'TRUE'GO
Use [host] Go
/ ****** Object: Table [DBO]. [GroupAccess] Script date: 2004-12-24 13:16:31 ****** / if EXISTS (SELECT * from dbo.sysobjects where id = Object_id (N '[dbo]. [Groupaccess]') And ObjectProperty (ID, n'susertable ') = 1) Drop Table [dbo]. [Groupaccess] Go
/ ****** Object: table [dbo]. [Groupaccounts] script date: 2004-12-24 13:16:31 ****** / if EXISTS (SELECT * from dbo.sysObjects where id = Object_id (N '[dbo]. [Groupaccounts]') And ObjectProperty (ID, n'susertable ') = 1) Drop Table [dbo]. [Groupaccounts] Go
/ ****** Object: table [dbo]. [Groupipaccess] script date: 2004-12-24 13:16:31 ****** / if exists (select * from dbo.sysObjects where id = Object_ID (N '[dbo]. [GroupiPaccess]') And ObjectProperty (ID, n'susertable ') = 1) DROP TABLE [DBO]. [GroupipAccess] go / ****** Object: Table [DBO]. UserAccess] Script date: 2004-12-24 13:16:31 ****** / if EXISTS (Select * from dbo.sysObjects where id = Object_id (n '[dbo]. [Useeraccess]') And ObjectProperty ID, N'ISUSERTABLE ') = 1) DROP TABLE [DBO]. [useeraccess] Go
/ ****** Object: table [dbo]. [Useeraccounts] script date: 2004-12-24 13:16:31 ******* / if EXISTS (SELECT * from dbo.sysObjects where id = Object_id (N '[dbo]. [Useraccounts]') And ObjectProperty (ID, n'susertable ') = 1) Drop Table [dbo]. [Useeraccounts] Go
/ ****** Object: table [dbo]. [Useripaccess] script date: 2004-12-24 13:16:31 ****** / if EXISTS (Select * from dbo.sysObjects where id = Object_id (N '[DBO]. [Useripaccess]') And ObjectProperty (ID, n'susertable ') = 1) DROP TABLE [DBO]. [Useripaccess] Go
/ ****** Object: table [dbo]. [GroupAccess] script date: 2004-12-24 13:16:34 ****** / CREATE TABLE [DBO]. [GroupAccess] ([IndexNo] [int] null, [username] [nvarchar] (50) collate chinese_prc_ci_as null, [access] [nvarchar] (200) collate chinese_prc_ci_as null, [GAID] [INT] Identity (1, 1) Not null) ON [primary] Go
/ ****** Object: table [dbo]. [Groupaccounts] script date: 2004-12-24 13:16:36 ****** / CREATE TABLE [DBO]. [GroupAccounts] ([username] [nvarchar] (50) collate chinese_prc_ci_as null, [access] [nvarchar] (200) collate chinese_prc_ci_as null, [notes] [nvarchar] (200) collate chinese_prc_ci_as null, [Gasid] [INT] Identity (1, 1) Not null ) On [primary] go / ****** Object: table [dbo]. [Groupipaccess] Script date: 2004-12-24 13:16:36 ****** / CREATE TABLE [DBO]. GroupiPaccess] NULL, [Username] [nvarchar] (50) collate chinese_prc_ci_as null, [access] [nvarchar] (200) collate chinese_prc_ci_as null, [gipaid] [int] Identity (1, 1) Not NULL) on [primary] Go
/ ****** Object: table [dbo]. [Useeraccess] script date: 2004-12-24 13:16:37 ****** / CREATE TABLE [DBO]. [Useeraccess] ([indexno] [int] null, [username] [nvarchar] (50) collate chinese_prc_ci_as null, [access] [nvarchar] (200) collate chinese_prc_ci_as null, [UAID] [INT] Identity (1, 1) Not null) ON [primary] Go
/ ****** Object: table [dbo]. [Useeraccounts] script date: 2004-12-24 13:16:37 ****** / CREATE TABLE [DBO]. [Useraccounts] ([ID] [int] Identity (1, 1) NOT NULL, [Username] [NVARCHAR] (50) Collate Chinese_PRC_CI_AS NOT NULL, [PASSWORD] [NVARCHAR] (50) Collate Chinese_PRC_CI_AS NULL, [Disable] [Bit] Not Null, [Access] ] [nvarchar] (255) collate chinese_prc_ci_as null, [ChangePass] [bit] NOT NULL, [PASSTYPE] [Tinyint] NOT NULL, [EXPIRATION] [SmallDateTime] NULL, [ExpirationType] [tinyint] not null, [SKEY] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL, [RelPaths] [bit] NOT NULL, [HomeDir] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL, [MessageFile] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL, [MaxUsers] [int ] NOT NULL, [MAXUP] [INT] NOT NULL, [MAXDOWN] [INT] NULL, [Ratioup] [INT] null, [Ratiodown] [INT] null, [Ratiocredit] [FLOAT] NULL, [Ratiotype] [ Tinyint] null, [quotaenable] [bit] NOT NULL, [Quotamax] [INT] NOT NULL, [Quotacurrent] [INT] NOT NULL, [Groups] [NVARCHAR] (255) CO Llate chinese_prc_ci_as null, [privilege] [tinyint] not null, [LockHomedir] [bit] not null) on [primary] go / ****** Object: table [dbo]. [Useripaccess] Script Date: 2004-12 -24 13:16:38 ****** / CREATE TABLE [DBO]. [UseriPaccess] ([IndexNo] [Smallint] null, [username] [nvarchar] (50) collate chinese_prc_ci_as null, [Access] [NVARCHAR ] (200) collate chinese_prc_ci_as null, [UIPAID] [INT] Identity (1, 1) Not null) on [primary] GO
Alter Table [DBO]. [GroupAccess] with nocheck address [pk_groupaccess] Primary Key Clustered ([GAID]) on [primary] GO
Alter Table [DBO]. [Groupaccounts] with nocheck add constraint [pk_groupaccounts] Primary Key Clustered ([Gasid]) on [primary] Go
ALTER TABLE [dbo]. [GroupIPAccess] WITH NOCHECK ADD CONSTRAINT [PK_GroupIPAccess] PRIMARY KEY CLUSTERED ([GIpAid]) ON [PRIMARY] GOALTER TABLE [dbo]. [UserAccess] WITH NOCHECK ADD CONSTRAINT [PK_UserAccess] PRIMARY KEY CLUSTERED ([UAid ]) ON [PRIMARY] GO
Alter Table [DBO]. [Useeraccounts] with nocheck add constraint [pk_useraccounts] Primary Key Clustered ([ID]) on [primary] Go
Alter Table [DBO]. [Useripaccess] with nocheck add constraint [pk_useripaccess] Primary Key Clustered ([UIPAID]) on [primary] GO
ALTER TABLE [dbo]. [UserAccounts] WITH NOCHECK ADD CONSTRAINT [DF_UserAccounts_Disable] DEFAULT (0) FOR [Disable], CONSTRAINT [DF_UserAccounts_ChangePass] DEFAULT (1) FOR [ChangePass], CONSTRAINT [DF_UserAccounts_PassType] DEFAULT (0) FOR [PassType] , CONSTRAINT [DF_UserAccounts_ExpirationType] DEFAULT (1) FOR [ExpirationType], CONSTRAINT [DF_UserAccounts_RelPaths] DEFAULT (0) FOR [RelPaths], CONSTRAINT [DF_UserAccounts_MaxUsers] DEFAULT ((-1)) FOR [MaxUsers], CONSTRAINT [DF_UserAccounts_MaxUp] DEFAULT (0 ) FOR [MaxUp], CONSTRAINT [DF_UserAccounts_MaxDown] DEFAULT (0) FOR [MaxDown], CONSTRAINT [DF_UserAccounts_RatioUp] DEFAULT (1) FOR [RatioUp], CONSTRAINT [DF_UserAccounts_RatioDown] DEFAULT (1) FOR [RatioDown], CONSTRAINT [DF_UserAccounts_RatioCredit] DEFAULT (0) FOR [RatioCredit], CONSTRAINT [DF_UserAccounts_RatioType] DEFAULT (0) FOR [RatioType], CONSTRAINT [DF_UserAccounts_QuotaEnable] DEFAULT (1) FOR [QuotaEnable], CONSTRAINT [DF_UserAccounts_QuotaMax] DEFAULT (0) FOR [QuotaMax], CONSTRAINT [DF_Us erAccounts_QuotaCurrent] DEFAULT (0) FOR [QuotaCurrent], CONSTRAINT [DF_UserAccounts_Privilege] DEFAULT (0) FOR [Privilege], CONSTRAINT [DF_UserAccounts_LockHomeDir] DEFAULT (1) FOR [LockHomeDir], CONSTRAINT [IX_UserAccounts] UNIQUE NONCLUSTERED ([UserName]) ON [ PRIMARY] Go
exec sp_addextendedproperty N'MS_Description ', N' directory permissions', N'user ', N'dbo', N'table ', N'UserAccounts', N'column', N'Access'GOexec sp_addextendedproperty N'MS_Description ', N 'Is it allowed to change the password', N'User ', N'TBO', N'TABLE ', N'USERACCOUNTS', N'COLUMN ', N'ChangePass'goexec sp_addextendedProperty N'MS_DEXTENDEDPROPERTY N'MS_DESCRIPTION', N 'account is disabled', N'User ', N'dbo', N'Table ', N'Useraccounts', N'Column', N'Disable'goexec sp_addextendedProperty N'MS_DESCRIPTION ', N' Expired Time ', N'User', N'dbo ', N'column', n'Expiration'goexec sp_addextendedproperty N'MS_DESCRIPTION ', N' Expansion ', N'User', N'dbo ', N'table', N 'Useeraccounts', N'ExpirationType'goexec sp_addextendedproperty N'MS_DEXTENDPROPERTY N'MS_DESCRIPTION ', N' User Group ', N'User', N'dbo ', N'TABLE', N'USERACCOUNTS ', N'COLUMN' , N'Groups'goexec sp_addextendedproperty N'MS_DESCRIPTION ', N' Home Directory ', N'TBO', N'table ', N'Useraccounts', N'Column', N'Homedir'goexec sp_addextendedProperty n 'Ms_description', n 'is locked in the main directory', N'User ', N'dbo', N'table ', N'Useraccounts', N'Column', N'Lockhom Edir'goexec sp_addextendedProperty N'MS_Description ', N' Maximum download rate ', n'user', n'dbo ', n'Table', n'usraccounts', n'column ', n'maxdown'goexec sp_addextendedproperty n'
MS_DESCRIPTION ', N' Maximum Upload Speed ', N'User', N'dbo ', N'Table', N'Useraccounts ', N'Column', N'Maxup'Goexec Sp_addextendedProperty N'MS_DESCRIPTION ', N' Max Land Use of users', N'User ', N'dbo', N'Table ', N'Useraccounts', N'Column', N'MaxUsers'goexec sp_addextendedProperty N'MS_DESCRIPTION ', N'Message file', N'User ' , N'dbo ', N'table', N'Column ', N'MessageFile'goexec sp_addextendedproperty N'MS_DEXTENDEDPROPERTY N'MS_DESBRIPTION', N'DD Class Type ', N'User', N'dbo ', N' Table ', N'Useraccounts', N'Column ', N'Passtype'goexec sp_addextendedproperty N'MS_DEXTENDPROPERTY N'MS_DESBRIPTION', N ', N'TEER', N'DBO ', N'TABLE', N'USERACCUNTS ', N'USERACCOUNTS', N 'Column', N'Password'goexec sp_addextendedproperty N'MS_DEXTENDPROPERTY N'MS_DESBRIPTION ', N' Management Permissions', N'TEER ', N'Useraccounts', N'column', N'Priviege ' GOexec sp_addextendedproperty N'MS_Description ', N' current quota ', N'user', N'dbo ', N'table', N'UserAccounts', N'column ', N'QuotaCurrent'GOexec sp_addextendedproperty N'MS_Description', N 'Enable Disk Quota', N'User ', N'dbo', N'Table ', N'Useraccounts', N'Column', N'quotaenable'goexec SP_ADDEXTENDEDPROPER Ty N'MS_Description ', N'User', N'dbo ', N'Table', N'Useraccounts ', N'Column', N'quoTamax'GoExec sp_addextendedProperty N'MS_DESCRIPTION ', N' Download ratio ', n'
User ', N'dbo', N'table ', N'Useraccounts', N'Column', N'ratiodown'goexec sp_addextendedproperty N'MS_DEXTENDEDPROPERTY N'MS_DESBRIPTION ', N'Upload ratio', N'User ', N'dbo', N'table ', N'Useraccounts', N'Column', N'ratioup 'Goexec sp_addextendedproperty N'MS_DEXTENDPROPERTY N'MS_DESBRIPTION', N 'User Name, N'TEBE', N'Useraccounts ', N'column', N'Username'go
ftp.cs code:
Using system; using system.configuration; using system.data; using system.data.sqlclient;
Namespace Host {///
Public String UserName; // User Name Public String Password; // Password Public Bool Disable; // Disable Account True: Disable Account False: Enable Account Public String Access; // Directory / IP Access Rule Public Byte Passtype; // Password Type 0: Rule Password 1: OTP S / KEY MD4 2: OTP S / Key MD5 Public Bool ChangePass; // Allows Change Password True: Allow FALSE: Prohibition of Public DateTime Expiration; // Expired Time PUBLIC BYTE ExpirationType; // Expired Type 1 : Delete 2: Disable Public STRING SKEY; PUBLIC BOOL Relpaths; // Requires Security Connection True: Requires False: No PUBLIC STRING HOMEDIR; // Main Directory Public String MessageFile; // Message File PUBLIC INT MAXUSERS; // Maximum User Public int maxup; // Maximum Upload rate public int maxdown; // Maximum download rate public Byte ratiotype; // ratio type public int RatiOUp; // Upload rate public int ratioDown; // download rate public float ratiocredit; // ratio trust Public Bool Quotaenable; // Allow quota True: Allow FALSE: Prohibition of public int quotamax; // Maximum quota public int quotacurrent; // Current quota public string groups; // User group public Byte privilege; // Administration 0: No permission 1: System Administrator 2: Group Administrator 3: Domain Administrator 4: Read-up administrator public bool lockHomedir; // Lock at the main directory TRUE: Lock FALSE: Do not lock
PUBLIC FTP () {// // TOD Add Constructor Logic // UserName = "Guest"; Password = "Guest"; disable = false; access = ""; passtype = 0; changePass = true; expression = DateTime.now.date; expressiontype = 1; sKey = ""; rentir = false; homedir = "; messagefile ="; MAXUSERS = 1; MAXUP = 100 * 1024; // 100K maxdown = 100 * 1024; // 100K ratiotype = 0; ratioup = 1; Ratiodown = 1; Ratiocredit = 0; quotaenable = true; quotamax = 10 * 1024 * 1024; // 10m quotacurrent = 0; groups = ""; privilege = 0; lockHomedir = true; conhost = New SqlConnection (ConfigurationSettings.AppSettings ["Constring"]); conhost.open ();
~ ftp () {conhost.close ();
public void Add () {// add the account SqlCommand cmdAdd = new SqlCommand ( "insert into UserAccounts (UserName, Password, Disable, Access, ChangePass, PassType, Expiration, ExpirationType, SKey, RelPaths, HomeDir, MessageFile, MaxUsers, MaxUp, MaxDown , RatioUp, RatioDown, RatioCredit, RatioType, QuotaEnable, QuotaMax, QuotaCurrent, Groups, Privilege, LockHomeDir) values (@ UserName, @ Password, @ Disable, @ Access, @ changePass, @ PassType, @ Expiration, @ ExpirationType, @ SKey, @ RelPaths, @ HomeDir, @ MessageFile, @ MaxUsers, @ MaxUp, @ MaxDown, @ RatioUp, @ RatioDown, @ RatioCredit, @ RatioType, @ QuotaEnable, @ QuotaMax, @ QuotaCurrent, @ Groups, @ Privilege, @ LockHomeDir) ", CONHOST);
Cmdadd.Parameters.Add ("@usename"; cmdadd.parameters.add ("@password", pass ()); cmdadd.parameters.add ("@disable", disable); cmdadd.parameters.add ( "@Access", access); cmdadd.parameters.add ("@ChangePass", ChangePass; cmdadd.Parameters.Add ("@Passtype"; cmdadd.parameters.add ("@Expiration", expression; cmdadd.parameters.add ("@ExpirationType"; cmdadd.parameters.add ("@skey", skey); cmdadd.parameters.add ("@relpaths", relpaths; cmdadd.Parameters.Add ("@ Homedir ", Homedir); cmdadd.parameters.add (" @MASSAGEFILE ", messagefile; cmdadd.parameters.add (" @maxusers "; cmdadd.parameters.add (" @maxup ", maxup); cmdadd. Parameters.add ("@maxdown", maxdown; cmdadd.parameters.add ("@ratious", ratioup; cmdadd.parameters.add ("@ratiodown", ratiodown; cmdadd.parameters.add ("@ratiocredit" , Ratiocredit; cmdadd.Parameters.Add ("@ratiotype", ratiotype); cmdadd.parameters.add ("@quotaenable", quo TAENABLE); cmdadd.parameters.add ("@quotamax", quotamax); cmdadd.parameters.add ("@quotacurrent", quotacurrent; cmdadd.parameters.add ("@groups", groups); cmdadd.parameters.add ("@Privilege"; cmdadd.parameters.add ("@lockhomedir", lockHomedir); //cmdadd.parameters.add ("@",); cmdadd.executenon query ()
Public string pass () {// Password encryption Random RNM = new random (); char A = (char) (RNM.Next (97, 123)); char b = (char) (RNM.Next (97, 123) ); String password = string.format ("{0} {1} {2}", a, b, password); password = formsauthentication.hashpasswordforstoringInfigfile (Password, "MD5"); password = string.format ("{0 } {1} {2} ", A, B, Password.toupper ()); Return Password;} Public Bool ModifyPass (String Oldpass, String Newpass) {// Modify Password Return true;}}}}
Example Webform1.aspx.cs:
using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls Using system.Web.ui.htmlcontrols; use system.web.security;
Namespace Host {///
#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///