home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / NIVB_SRC / FILEINFO.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-06-03  |  12.0 KB  |  415 lines

  1. VERSION 2.00
  2. Begin Form FileInfoForm 
  3.    Caption         =   "File Services Test"
  4.    Height          =   4515
  5.    Left            =   1020
  6.    LinkTopic       =   "Form2"
  7.    ScaleHeight     =   4110
  8.    ScaleWidth      =   6930
  9.    Top             =   1335
  10.    Width           =   7050
  11.    Begin Frame Frame2 
  12.       Caption         =   "Extended File Attributes"
  13.       Height          =   1455
  14.       Left            =   3720
  15.       TabIndex        =   4
  16.       Top             =   1920
  17.       Width           =   2415
  18.       Begin CheckBox WABox 
  19.          Caption         =   "Write audit"
  20.          Height          =   255
  21.          Left            =   480
  22.          TabIndex        =   15
  23.          Top             =   1080
  24.          Width           =   1575
  25.       End
  26.       Begin CheckBox RABox 
  27.          Caption         =   "Read audit"
  28.          Height          =   255
  29.          Left            =   480
  30.          TabIndex        =   14
  31.          Top             =   840
  32.          Width           =   1575
  33.       End
  34.       Begin CheckBox IBox 
  35.          Caption         =   "Indexed"
  36.          Height          =   255
  37.          Left            =   480
  38.          TabIndex        =   13
  39.          Top             =   600
  40.          Width           =   1575
  41.       End
  42.       Begin CheckBox TBox 
  43.          Caption         =   "Transactional"
  44.          Height          =   255
  45.          Left            =   480
  46.          TabIndex        =   12
  47.          Top             =   360
  48.          Width           =   1575
  49.       End
  50.    End
  51.    Begin Frame Frame1 
  52.       Caption         =   "File Attributes"
  53.       Height          =   2175
  54.       Left            =   360
  55.       TabIndex        =   3
  56.       Top             =   1320
  57.       Width           =   1695
  58.       Begin CheckBox ShBox 
  59.          Caption         =   "Sharable"
  60.          Height          =   255
  61.          Left            =   120
  62.          TabIndex        =   11
  63.          Top             =   1800
  64.          Width           =   1455
  65.       End
  66.       Begin CheckBox ABox 
  67.          Caption         =   "Archive"
  68.          Height          =   255
  69.          Left            =   120
  70.          TabIndex        =   10
  71.          Top             =   1560
  72.          Width           =   1455
  73.       End
  74.       Begin CheckBox SubBox 
  75.          Caption         =   "Subdirectory"
  76.          Height          =   255
  77.          Left            =   120
  78.          TabIndex        =   9
  79.          Top             =   1320
  80.          Width           =   1455
  81.       End
  82.       Begin CheckBox XBox 
  83.          Caption         =   "Execute only"
  84.          Height          =   255
  85.          Left            =   120
  86.          TabIndex        =   8
  87.          Top             =   1080
  88.          Width           =   1455
  89.       End
  90.       Begin CheckBox SBox 
  91.          Caption         =   "System"
  92.          Height          =   255
  93.          Left            =   120
  94.          TabIndex        =   7
  95.          Top             =   840
  96.          Width           =   1455
  97.       End
  98.       Begin CheckBox HBox 
  99.          Caption         =   "Hidden"
  100.          Height          =   255
  101.          Left            =   120
  102.          TabIndex        =   6
  103.          Top             =   600
  104.          Width           =   1455
  105.       End
  106.       Begin CheckBox ROBox 
  107.          Caption         =   "Read-only"
  108.          Height          =   255
  109.          Left            =   120
  110.          TabIndex        =   5
  111.          Top             =   360
  112.          Width           =   1455
  113.       End
  114.    End
  115.    Begin CommandButton OKButton 
  116.       Caption         =   "&OK"
  117.       Height          =   375
  118.       Left            =   2880
  119.       TabIndex        =   0
  120.       Top             =   3600
  121.       Width           =   855
  122.    End
  123.    Begin Label OwnerLabel 
  124.       Height          =   255
  125.       Left            =   960
  126.       TabIndex        =   27
  127.       Top             =   840
  128.       Width           =   2055
  129.    End
  130.    Begin Label Label7 
  131.       Alignment       =   1  'Right Justify
  132.       Caption         =   "Owner:"
  133.       Height          =   255
  134.       Left            =   120
  135.       TabIndex        =   26
  136.       Top             =   840
  137.       Width           =   735
  138.    End
  139.    Begin Label LastArchivedLabel 
  140.       Height          =   255
  141.       Left            =   4680
  142.       TabIndex        =   25
  143.       Top             =   1560
  144.       Width           =   2055
  145.    End
  146.    Begin Label Label6 
  147.       Alignment       =   1  'Right Justify
  148.       Caption         =   "Last archived:"
  149.       Height          =   255
  150.       Left            =   3240
  151.       TabIndex        =   24
  152.       Top             =   1560
  153.       Width           =   1335
  154.    End
  155.    Begin Label LastUpdateLabel 
  156.       Height          =   255
  157.       Left            =   4680
  158.       TabIndex        =   23
  159.       Top             =   1320
  160.       Width           =   2055
  161.    End
  162.    Begin Label Label5 
  163.       Alignment       =   1  'Right Justify
  164.       Caption         =   "Last updated:"
  165.       Height          =   255
  166.       Left            =   3240
  167.       TabIndex        =   22
  168.       Top             =   1320
  169.       Width           =   1335
  170.    End
  171.    Begin Label LastAccessLabel 
  172.       Height          =   255
  173.       Left            =   4680
  174.       TabIndex        =   21
  175.       Top             =   1080
  176.       Width           =   2055
  177.    End
  178.    Begin Label Label4 
  179.       Alignment       =   1  'Right Justify
  180.       Caption         =   "Last accessed:"
  181.       Height          =   255
  182.       Left            =   3240
  183.       TabIndex        =   20
  184.       Top             =   1080
  185.       Width           =   1335
  186.    End
  187.    Begin Label CreatedLabel 
  188.       Height          =   255
  189.       Left            =   4680
  190.       TabIndex        =   19
  191.       Top             =   840
  192.       Width           =   2055
  193.    End
  194.    Begin Label Label3 
  195.       Alignment       =   1  'Right Justify
  196.       Caption         =   "Created:"
  197.       Height          =   255
  198.       Left            =   3720
  199.       TabIndex        =   18
  200.       Top             =   840
  201.       Width           =   855
  202.    End
  203.    Begin Label Label2 
  204.       Alignment       =   1  'Right Justify
  205.       Caption         =   "Size:"
  206.       Height          =   255
  207.       Left            =   240
  208.       TabIndex        =   17
  209.       Top             =   1080
  210.       Width           =   615
  211.    End
  212.    Begin Label Label1 
  213.       Caption         =   "Information for file:"
  214.       Height          =   255
  215.       Left            =   120
  216.       TabIndex        =   16
  217.       Top             =   120
  218.       Width           =   2655
  219.    End
  220.    Begin Label FileSizeLabel 
  221.       Height          =   255
  222.       Left            =   960
  223.       TabIndex        =   2
  224.       Top             =   1080
  225.       Width           =   1575
  226.    End
  227.    Begin Label FilePathLabel 
  228.       Height          =   255
  229.       Left            =   360
  230.       TabIndex        =   1
  231.       Top             =   360
  232.       Width           =   6375
  233.    End
  234. Dim locked%
  235. Sub ABox_Click ()
  236.     If locked% Then
  237.         locked% = False
  238.         If (Abox.Value = 0) Then
  239.             Abox.Value = 1
  240.         Else
  241.             Abox.Value = 0
  242.         End If
  243.         locked% = True
  244.     End If
  245. End Sub
  246. Sub Form_Load ()
  247.     locked% = False
  248.     server$ = String$(48, 0)
  249.     volume$ = String$(16, 0)
  250.     dirs$ = String$(255, 0)
  251.     dirPath$ = SelectFileForm.CurrDirLabel.Caption + "\" + SelectFileForm.FileNameBox.Text
  252.     cCode% = ParsePath(dirPath$, server$, volume$, dirs$)
  253.     volume$ = Left$(volume$, InStr(volume$, Chr$(0)) - 1)
  254.     dirs$ = Left$(dirs$, InStr(dirs$, Chr$(0)) - 1)
  255.     filePath$ = volume$ + ":/" + dirs$
  256.     fileName$ = String$(15, 0)
  257.     handle% = 0
  258.     sequence% = -1
  259.     cCode% = ScanFileInformation(handle%, filePath$, FA_NORMAL And FA_HIDDEN And FA_SYSTEM, sequence%, fileName$, attrib%, extAttrib%, size&, cDate%, lastAcc%, lastUpd&, lastArch&, ownerID&)
  260.     If (cCode% <> SUCCESSFUL) Then
  261.         MsgBox "Unable to get file information", MB_OK, "Error"
  262.     Else
  263.         'file path
  264.         FilePathLabel.Caption = filePath$
  265.         'attributes
  266.         If (attrib% And FA_READ_ONLY) Then ROBox.Value = 1
  267.         If (attrib% And FA_HIDDEN) Then HBox.Value = 1
  268.         If (attrib% And FA_SYSTEM) Then SBox.Value = 1
  269.         If (attrib% And FA_EXECUTE_ONLY) Then XBox.Value = 1
  270.         If (attrib% And FA_DIRECTORY) Then SubBox.Value = 1
  271.         If (attrib% And FA_ARCHIVE) Then Abox.Value = 1
  272.         If (attrib% And FA_SHARABLE) Then ShBox.Value = 1
  273.         'extended attributes
  274.         If (extAttrib% And FA_TRANSACTIONAL) Then TBox.Value = 1
  275.         If (extAttrib% And FA_INDEXED) Then IBox.Value = 1
  276.         If (extAttrib% And FA_READ_AUDIT) Then RABox.Value = 1
  277.         If (extAttrib% And FA_WRITE_AUDIT) Then WABox.Value = 1
  278.         'Ignore the Purge, Copy Inhibit, Delete Inhibit, and Rename Inhibit bits for now
  279.         'file size
  280.         FileSizeLabel.Caption = Str$(size&)
  281.         'creation date
  282.         CreatedLabel.Caption = GetDate$(cDate%, 0)
  283.         'last accessed date
  284.         LastAccessLabel.Caption = GetDate$(lastAcc%, 0)
  285.         'last update date and time
  286.         theTime% = (lastUpd& And &HFFFF0000) / &H10000
  287.         theDate% = lastUpd& - (lastUpd& And &HFFFF0000)
  288.         LastUpdateLabel.Caption = GetDate$(theDate%, theTime%)
  289.         'last archive date and time
  290.         theTime% = (lastArch& And &HFFFF0000) / &H10000
  291.         theDate% = lastArch& - (lastArch& And &HFFFF0000)
  292.         LastArchivedLabel.Caption = GetDate$(theDate%, theTime%)
  293.         'owner
  294.         ownerName$ = String$(48, 0)
  295.         cCode% = GetBinderyObjectName(ownerID&, ownerName$, OT_USER)
  296.         If (cCode% <> SUCCESSFUL) Then ownerName$ = "Unknown user"
  297.         OwnerLabel.Caption = ownerName$
  298.     End If
  299.     locked% = True
  300. End Sub
  301. Sub HBox_Click ()
  302.     If locked% Then
  303.         locked% = False
  304.         If (HBox.Value = 0) Then
  305.             HBox.Value = 1
  306.         Else
  307.             HBox.Value = 0
  308.         End If
  309.         locked% = True
  310.     End If
  311. End Sub
  312. Sub IBox_Click ()
  313.     If locked% Then
  314.         locked% = False
  315.         If (IBox.Value = 0) Then
  316.             IBox.Value = 1
  317.         Else
  318.             IBox.Value = 0
  319.         End If
  320.         locked% = True
  321.     End If
  322. End Sub
  323. Sub OKButton_Click ()
  324.     Unload SelectFileForm
  325.     Unload FileInfoForm
  326. End Sub
  327. Sub RABox_Click ()
  328.     If locked% Then
  329.         locked% = False
  330.         If (RABox.Value = 0) Then
  331.             RABox.Value = 1
  332.         Else
  333.             RABox.Value = 0
  334.         End If
  335.         locked% = True
  336.     End If
  337. End Sub
  338. Sub ROBox_Click ()
  339.     If locked% Then
  340.         locked% = False
  341.         If (ROBox.Value = 0) Then
  342.             ROBox.Value = 1
  343.         Else
  344.             ROBox.Value = 0
  345.         End If
  346.         locked% = True
  347.     End If
  348. End Sub
  349. Sub SBox_Click ()
  350.     If locked% Then
  351.         locked% = False
  352.         If (SBox.Value = 0) Then
  353.             SBox.Value = 1
  354.         Else
  355.             SBox.Value = 0
  356.         End If
  357.         locked% = True
  358.     End If
  359. End Sub
  360. Sub ShBox_Click ()
  361.     If locked% Then
  362.         locked% = False
  363.         If (ShBox.Value = 0) Then
  364.             ShBox.Value = 1
  365.         Else
  366.             ShBox.Value = 0
  367.         End If
  368.         locked% = True
  369.     End If
  370. End Sub
  371. Sub SubBox_Click ()
  372.     If locked% Then
  373.         locked% = False
  374.         If (SubBox.Value = 0) Then
  375.             SubBox.Value = 1
  376.         Else
  377.             SubBox.Value = 0
  378.         End If
  379.         locked% = True
  380.     End If
  381. End Sub
  382. Sub TBox_Click ()
  383.     If locked% Then
  384.         locked% = False
  385.         If (TBox.Value = 0) Then
  386.             TBox.Value = 1
  387.         Else
  388.             TBox.Value = 0
  389.         End If
  390.         locked% = True
  391.     End If
  392. End Sub
  393. Sub WABox_Click ()
  394.     If locked% Then
  395.         locked% = False
  396.         If (WABox.Value = 0) Then
  397.             WABox.Value = 1
  398.         Else
  399.             WABox.Value = 0
  400.         End If
  401.         locked% = True
  402.     End If
  403. End Sub
  404. Sub XBox_Click ()
  405.     If locked% Then
  406.         locked% = False
  407.         If (XBox.Value = 0) Then
  408.             XBox.Value = 1
  409.         Else
  410.             XBox.Value = 0
  411.         End If
  412.         locked% = True
  413.     End If
  414. End Sub
  415.