www.pudn.com > AutoUpdate.rar > Init.bas


Attribute VB_Name = "Init" 
Option Explicit 
 
Public objServerInfo As SERVERINFO 
Public objSystemInfo As SYSTEMINFO 
 
Public Sub Init() 
    Set objServerInfo = New SERVERINFO 
    objServerInfo.sServerAddress = GetServerAddress 
    objServerInfo.sHttpServerPort = GetHttpServerPort 
    objServerInfo.sFtpServerPort = GetFtpServerPort 
    objServerInfo.sCommunicationPort = GetCommunicationPort 
    objServerInfo.sTransferPort = GetTransferPort 
     
    Set objSystemInfo = New SYSTEMINFO 
    objSystemInfo.sAppPath = GetAppPath 
     
End Sub 
 
Private Function GetServerAddress() As String 
    GetServerAddress = SERVER_ADDRESS 
End Function 
 
Private Function GetHttpServerPort() As String 
    GetHttpServerPort = HTTPSERVER_PORT 
End Function 
 
Private Function GetFtpServerPort() As String 
    GetFtpServerPort = FTPSERVER_PORT 
End Function 
 
Private Function GetCommunicationPort() As String 
    GetCommunicationPort = COMMUNICATION_PORT 
End Function 
 
Private Function GetTransferPort() As String 
    GetTransferPort = TRANSFER_PORT 
End Function 
 
'''''''''''''''''''''''''''''''''''' 
'' get the app path 
'''''''''''''''''''''''''''''''''''' 
Private Function GetAppPath() As String 
    Dim sAppPath As String 
     
    sAppPath = App.Path 
    If Right$(sAppPath, 1) <> "\" Then sAppPath = sAppPath & "\" 
     
    GetAppPath = sAppPath 
End Function