home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD51904252000.psc / MainApp.cls < prev    next >
Encoding:
Visual Basic class definition  |  2000-04-25  |  2.8 KB  |  97 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "MainApp"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = False
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. Option Explicit
  15.  
  16. Public Enum eState
  17.   Log_In_Out = 0
  18.   Transfer_Parameters = 1
  19.   Service_Commands = 2
  20.   Busy = 3
  21. End Enum
  22.  
  23. Public Type Privtyp
  24.   Path As String
  25.   Accs As String '[R]ead,[W]rite,[D]elete,e[X]ecute > Files
  26.                  '[L]ist,[M]ake,[K]ill,[S]ubs       > Dirs
  27. End Type
  28.  
  29. Public Type UserInfo
  30.   Name As String 'list of the users which can access to server file-system
  31.   Pass As String 'list of passwords of each user which can access to server file-system
  32.   Pcnt As Integer
  33.   Priv(20) As Privtyp
  34.   Home As String 'default directory of each user
  35. End Type
  36.  
  37. Public Type User
  38.   'indexes user name and password inside
  39.   '<usernames_list> and <passwords_list> arrays
  40.   list_index As Integer
  41.   control_slot As Long 'slot number used by client to send commands to server. On this slot also travel the replies of server.
  42.   data_slot As Long    'slot number used by server to send data to client
  43.   IP_Address As String 'client IP address
  44.   Port As Integer      'number of client data port
  45.   'representation type to use for data
  46.   'encoding (ex. ASCII o EBCDIC), default type is A (= ASCII)
  47.   data_representation As String
  48.   'type of vertical format control
  49.   '(ie. line-feed, form-feed), default
  50.   'value is N (No print = no command)
  51.   data_format_ctrls As String
  52.   'file structure (ex. File-structure, Record-structure),
  53.   'default value is F (File-structure = no internal
  54.   'structure)
  55.   data_structure As String
  56.   'indicates if the data are processing before
  57.   'transmission (ex. Stream-mode, Block-mode),
  58.   'default value is S (Stream-mode = no
  59.   'processing)
  60.   data_tx_mode As String
  61.   'current working directory
  62.   cur_dir As String
  63.   'user state:
  64.   'in state 0 the user sends access control commands;
  65.   'in state 1 the user sends transfer parameter commands;
  66.   'in state 2 the user sends FTP service commands.
  67.   State As eState
  68.   full As Integer  'if true the record is already in use
  69.   temp_data As String  'contains temporary data
  70.   Jenny As Balk
  71. End Type
  72.  
  73. Private frmFTP As New frmFTP
  74.  
  75.  
  76. Private Sub Class_Initialize()
  77.    Set frmFTP.MainApp = Me
  78.    frmFTP.Caption = frmFTP.Caption
  79.    frmFTP.Show
  80.    FTP_Init Me
  81. End Sub
  82.  
  83. Friend Sub Closing()
  84.    Unload frmFTP
  85.    Set frmFTP = Nothing
  86.    Call FreeProcessWindow
  87. End Sub
  88.  
  89. Public Sub SvrLogToScreen(ByVal str As String)
  90.   frmFTP.LogWnd.AddItem str
  91.   frmFTP.LogWnd.Selected(frmFTP.LogWnd.ListCount - 1) = True
  92. End Sub
  93.  
  94. Public Sub UsrCnt(ByVal users As Integer)
  95.   frmFTP.UsrCnt.Text = users
  96. End Sub
  97.