Use a program to automatically create an FTP account (odbc settings of serv-u)
Steps:
1. Create a database (any database SQL SERVER or ACCESS can be used)
2. Create DNS
3. Install Serv-U
4. Create a domain
5. Finished. Haha ~!
Serv-u build 6.0.0.1
★Serv-u ftp Server 6.0.0.1 final
Very good FTP server software, which is easy to set, powerful, and stable in performance.
Now you can build your own FTP server.
Description:
1. Install the original English software first.
2. Exit the FTP Serv-U application! Including the system bar icon!
3. decompress the package and enter your installation directory.
4. The Chinese package contains an enterprise version of the cracking patch:
Serv-U6001cr.exe, if needed, you can crack, please before cracking
Stop the system's servudaemon.exe process or stop the Serv-U service.
Then copy the cracked file to the Serv-U installation directory to crack the file. After cracking
For "Enterprise Edition" that never expires, if the previous version is used
We will report that you have stolen the registration code. Please go to "local server-license"
Select "delete key.
5. Some users in the original English version may lose their settings after the Chinese version.
The reason for the difference between the Chinese and English versions is that you can only reset it.
. In the past, the Chinese version was used.
6. If you have used my Chinese patch before, please use the old "Chinese" in the original directory
Delete the "ming.txt" file and then use the new Chinese patch.
SQL statement for creating a database:
/***** Object: Database host Script Date: 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_AS
GO
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'
GO
Exec 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'ansi null default', n'false'
GO
Exec sp_dboption N 'host', N 'cursive trigger', N 'false'
GO
Exec sp_dboption N 'host', n'ansi 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'ansi warnings', n'false'
GO
Exec sp_dboption N 'host', n'auto create statistics ', n'true'
GO
Exec sp_dboption N 'host', n'auto update statistics ', n'true'
GO
Use [host]
GO
/***** Object: Table [dbo]. [GroupAccess] Script Date: 13:16:31 ******/
If exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [GroupAccess] ') and OBJECTPROPERTY (id, n'isusertable') = 1)
Drop table [dbo]. [GroupAccess]
GO
/***** Object: Table [dbo]. [GroupAccounts] Script Date: 13:16:31 ******/
If exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [GroupAccounts] ') and OBJECTPROPERTY (id, n'isusertable') = 1)
Drop table [dbo]. [GroupAccounts]
GO
/***** Object: Table [dbo]. [GroupIPAccess] Script Date: 13:16:31 ******/
If exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [GroupIPAccess] ') and OBJECTPROPERTY (id, n'isusertable') = 1)
Drop table [dbo]. [GroupIPAccess]
GO
/***** Object: Table [dbo]. [UserAccess] Script Date: 13:16:31 ******/
If exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [UserAccess] ') and OBJECTPROPERTY (id, n'isusertable') = 1)
Drop table [dbo]. [UserAccess]
GO
/***** Object: Table [dbo]. [UserAccounts] Script Date: 13:16:31 ******/
If exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [UserAccounts] ') and OBJECTPROPERTY (id, n'isusertable') = 1)
Drop table [dbo]. [UserAccounts]
GO
/***** Object: Table [dbo]. [UserIPAccess] Script Date: 13:16:31 ******/
If exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [UserIPAccess] ') and OBJECTPROPERTY (id, n'isusertable') = 1)
Drop table [dbo]. [UserIPAccess]
GO
/***** Object: Table [dbo]. [GroupAccess] Script Date: 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: 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: 13:16:36 ******/
Create table [dbo]. [GroupIPAccess] (
[IndexNo] [int] 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]. [UserAccess] Script Date: 13:16:37 ******/
Create table [dbo]. [UserAccess] (
[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]. [UserAccounts] Script Date: 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] not 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] not 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) COLLATE Chinese_PRC_CI_AS NULL,
[Privilege] [tinyint] not null,
[LockHomeDir] [bit] NOT NULL
) ON [PRIMARY]
GO
/***** Object: Table [dbo]. [UserIPAccess] Script Date: 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 ADD
CONSTRAINT [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]
GO
Alter table [dbo]. [UserAccess] WITH NOCHECK ADD
CONSTRAINT [PK_UserAccess] PRIMARY KEY CLUSTERED
(
[UAid]
) ON [PRIMARY]
GO
Alter table [dbo]. [UserAccounts] 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_UserAccounts_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 authorization', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'access'
GO
Exec sp_addextendedproperty N 'Ms _ description', n' whether to allow Password Change ', n'user', n'dbo', n'table', n'useraccounts ', N 'column ', N 'changepass'
GO
Exec sp_addextendedproperty N 'Ms _ description', n'account disabled? ', n'user', n'dbo', n'table', n'useraccounts ', N 'column ', N 'disable'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'expiration time', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'expiration'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'expiration type', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'expirationtype'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'User Group', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'groups'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'main directory', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'homedir'
GO
Exec sp_addextendedproperty N 'Ms _ description', n' whether it is locked in the main directory ', n'user', n'dbo', n'table', n'useraccounts ', N 'column ', N 'lockhomedir'
GO
Exec sp_addextendedproperty N 'Ms _ description', n'maximum download rate', n'user', n'dbo', n'table', n'useraccounts ', N 'column', N 'maxlow'
GO
Exec sp_addextendedproperty N 'Ms _ description', n'maximum upload rate', n'user', n'dbo', n'table', n'useraccounts ', N 'column ', N 'maxup'
GO
Exec sp_addextendedproperty N 'Ms _ description', n'maximum login user', n'user', n'dbo', n'table', n'useraccounts ', N 'column ', N 'maxusers'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'message file', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'messagefile'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'password type', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'passtype'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'Password', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'Password'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'administrative authorization', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'privilege'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'current quota ', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'quotacurrent'
GO
Exec sp_addextendedproperty N 'Ms _ description', n' enable Disk Quota ', n'user', n'dbo', n'table', n'useraccounts ', N 'column', n' QuotaEnable'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'maximum limited', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'quotamax'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'Download rate', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', n' RatioDown'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'upload ratio ', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', n' RatioUp'
GO
Exec sp_addextendedproperty N 'Ms _ description', N 'username', N 'user', N 'dbo', N 'table', N 'useraccounts', N 'column ', N 'username'
GO
Ftp. cs code:
Using System;
Using System. Web. Security;
Using System. Configuration;
Using System. Data;
Using System. Data. SqlClient;
Namespace host
{
/// <Summary>
/// Ftp summary.
/// </Summary>
Public class ftp
{
Private SqlConnection conHost;
Public string UserName; // User Name
Public string Password; // Password
Public bool Disable; // Disabled Account true: Disabled Account false: enabled account
Public string Access; // directory/IP address Access rule
Public byte PassType; // password type 0: Rule password 1: otp s/KEY MD4 2: otp s/KEY MD5
Public bool ChangePass; // you can change the password to true: false: Disabled.
Public DateTime Expiration; // Expiration time
Public byte ExpirationType; // expiration type 1: Delete 2: Disabled
Public string SKey;
Public bool RelPaths; // required for secure connection. true: required. false: not required.
Public string HomeDir; // main directory
Public string MessageFile; // message file
Public int MaxUsers; // The maximum number of users.
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; // rate of trust
Public bool QuotaEnable; // allowed quota true: allowed false: Disabled
Public int QuotaMax; // maximum quota
Public int QuotaCurrent; // current quota
Public string Groups; // User Group
Public byte Privilege; // management permission 0: no permission 1: System Administrator 2: Group Administrator 3: domain administrator 4: Read-Only Administrator
Public bool LockHomeDir; // locked in the main directory. true: Locked. false: unlocked.
Public ftp ()
{
//
// Add the constructor logic here
//
UserName = "guest ";
Password = "guest ";
Disable = false;
Access = "";
PassType = 0;
ChangePass = true;
Expiration = DateTime. Now. Date;
ExpirationType = 1;
SKey = "";
RelPaths = false;
HomeDir = "";
MessageFile = "";
MaxUsers = 1;
MaxUp = 100*1024; // 100 K
MaxDown = 100*1024; // 100 K
RatioType = 0;
RatioUp = 1;
RatioDown = 1;
RatioCredit = 0;
QuotaEnable = true;
QuotaMax = 10*1024*1024; // 10 M
QuotaCurrent = 0;
Groups = "";
Privilege = 0;
LockHomeDir = true;
ConHost = new SqlConnection (ConfigurationSettings. receivettings ["conString"]);
ConHost. Open ();
}
~ Ftp ()
{
ConHost. Close ();
}
Public void Add ()
{
// Add an account
SqlCommand into add = 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, quota, 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 );
Using Add. Parameters. Add ("@ UserName", UserName );
Using Add. Parameters. Add ("@ Password", pass ());
Parameter Add. Parameters. Add ("@ Disable", Disable );
Using Add. Parameters. Add ("@ Access", Access );
Using Add. Parameters. Add ("@ ChangePass", ChangePass );
Parameters Add. Parameters. Add ("@ PassType", PassType );
Using Add. Parameters. Add ("@ Expiration", Expiration );
Using Add. Parameters. Add ("@ ExpirationType", ExpirationType );
Using Add. Parameters. Add ("@ SKey", SKey );
Using Add. Parameters. Add ("@ RelPaths", RelPaths );
Using Add. Parameters. Add ("@ HomeDir", HomeDir );
Parameters Add. Parameters. Add ("@ MessageFile", MessageFile );
Using Add. Parameters. Add ("@ MaxUsers", MaxUsers );
Using Add. Parameters. Add ("@ MaxUp", MaxUp );
Using Add. Parameters. Add ("@ MaxDown", MaxDown );
Using Add. Parameters. Add ("@ RatioUp", RatioUp );
Using Add. Parameters. Add ("@ RatioDown", RatioDown );
Using Add. Parameters. Add ("@ RatioCredit", RatioCredit );
Using Add. Parameters. Add ("@ RatioType", RatioType );
Using Add. Parameters. Add ("@ QuotaEnable", QuotaEnable );
Using Add. Parameters. Add ("@ QuotaMax", QuotaMax );
Parameter Add. Parameters. Add ("@ QuotaCurrent", QuotaCurrent );
Using Add. Parameters. Add ("@ Groups", Groups );
Using Add. Parameters. Add ("@ Privilege", Privilege );
Using Add. Parameters. Add ("@ LockHomeDir", LockHomeDir );
// Configure Add. Parameters. Add ("@",);
Revoke Add. ExecuteNonQuery ();
}
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. HashPasswordForStoringInConfigFile (password, "md5 ");
Password = string. Format ("{0} {1} {2}", a, B, password. ToUpper ());
Return password;
}
Public bool modifypass (string oldpass, string newpass)
{
// Change the 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;
Using System. Web. Security;
Namespace host
{
/// <Summary>
/// Summary of WebForm1.
/// </Summary>
Public class WebForm1: System. Web. UI. Page
{
Protected System. Web. UI. WebControls. Label Label1;
Private void Page_Load (object sender, System. EventArgs e)
{
// Place user code here to initialize the page
Ftp test = new ftp ();
Test. UserName = "t ";
Test. Password = "t ";
Test. Access = "D :\\ wwwroot \ test | RWAMLCDP ";
Test. HomeDir = "D :\\ wwwroot \ test ";
Test. Groups = "test ";
Test. Add ();
Label1.Text = "successful ";
}
# Code generated by region Web Form Designer
Override protected void OnInit (EventArgs e)
{
//
// CODEGEN: This call is required by the ASP. NET Web form designer.
//
InitializeComponent ();
Base. OnInit (e );
}
/// <Summary>
/// The designer supports the required methods-do not use the code editor to modify
/// Content of this method.
/// </Summary>
Private void InitializeComponent ()
{
This. Load + = new System. EventHandler (this. Page_Load );
}
# Endregion
}
}
Related Images:
Create DNS:
2. Create a domain:
3. Prepare Serv-U:
Trackback: http://tb.blog.csdn.net/TrackBack.aspx? PostId = 274585
From: http://blog.csdn.net/iuhxq/archive/2005/01/31/274585.aspx