a , Task Introduction:
Account NumberSyncTask,Syncobject is the database account information and thePublishing Machineof local accounts,itis a background service program that listens on a port, receives requests from clients,processingfour types from the clientCommand:(1 )Scanfull table, Sync account;(2) Add the specified account number;(3) Disables the specified account(4 ) generatesBHOConfigurationfile. where Commands(1)mostComplex,need toconsider both the account number and the local account in the database, and all the synchronization bases are based on the account number in the database, if there is one in the database, but not locally, then automatically create the account locally;database does not have, but not locally, then disable the local account. specificof theLogic canReference Code.
two , Core Code Anatomy :
(1 )Accounssyncservice program Analysis :
N Config folders, configuration files
N AccountsSyncService.cs , Account Synchronization the main program :
start the service, open a thread, listening port : startservice () , onstart () , listen ()
P Receive Account Synchronization command, and perform account synchronization of four kinds of operations : Accounssync ()
P Initialize Database Connection : initializetables ()
P Create BHO page Password-populated configuration file: Createbhologinxml ()
(2 )accountmanagement program Analysis :
accountmanager.h accountmanager.cpp : includes add account, delete account number, add , change password, etc.
(3 )ServiceInstall program Analysis: Background Service program installation file generation Project , you can automatically generate a service program in the background to Double click the installed executable file " . msi " file
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/82/21/wKiom1dMGfDzhvVCAAF0I4JU68A912.png "title=" Picture 1.png "alt=" Wkiom1dmgfdzhvvcaaf0i4ju68a912.png "/>
Fortress Machine-Kylin Open source Fortress machine code Analysis-app release account sync section