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

  1. VERSION 2.00
  2. Begin Form AFPInfoForm 
  3.    Caption         =   "AFP File Information"
  4.    Height          =   5325
  5.    Left            =   1035
  6.    LinkTopic       =   "Form1"
  7.    ScaleHeight     =   4920
  8.    ScaleWidth      =   6855
  9.    Top             =   1140
  10.    Width           =   6975
  11.    Begin Frame Frame3 
  12.       Caption         =   "File Size"
  13.       Height          =   735
  14.       Left            =   120
  15.       TabIndex        =   10
  16.       Top             =   1440
  17.       Width           =   6615
  18.       Begin Label ResourceForkLengthLabel 
  19.          Height          =   255
  20.          Left            =   5160
  21.          TabIndex        =   15
  22.          Top             =   360
  23.          Width           =   975
  24.       End
  25.       Begin Label DataForkLengthLabel 
  26.          Height          =   255
  27.          Left            =   1560
  28.          TabIndex        =   14
  29.          Top             =   360
  30.          Width           =   975
  31.       End
  32.       Begin Label Label6 
  33.          Alignment       =   1  'Right Justify
  34.          Caption         =   "Resource Fork:"
  35.          Height          =   255
  36.          Left            =   3600
  37.          TabIndex        =   12
  38.          Top             =   360
  39.          Width           =   1455
  40.       End
  41.       Begin Label Label5 
  42.          Alignment       =   1  'Right Justify
  43.          Caption         =   "Data Fork:"
  44.          Height          =   255
  45.          Left            =   360
  46.          TabIndex        =   11
  47.          Top             =   360
  48.          Width           =   1095
  49.       End
  50.    End
  51.    Begin Frame Frame1 
  52.       Caption         =   "File Attributes"
  53.       Height          =   1935
  54.       Left            =   120
  55.       TabIndex        =   8
  56.       Top             =   2280
  57.       Width           =   6615
  58.       Begin Label IndexLabel 
  59.          Height          =   255
  60.          Left            =   4320
  61.          TabIndex        =   34
  62.          Top             =   1440
  63.          Width           =   975
  64.       End
  65.       Begin Label TransLabel 
  66.          Height          =   255
  67.          Left            =   4320
  68.          TabIndex        =   33
  69.          Top             =   1200
  70.          Width           =   975
  71.       End
  72.       Begin Label SearchLabel 
  73.          Height          =   375
  74.          Left            =   4320
  75.          TabIndex        =   32
  76.          Top             =   600
  77.          Width           =   2175
  78.       End
  79.       Begin Label ArchiveLabel 
  80.          Height          =   255
  81.          Left            =   1800
  82.          TabIndex        =   31
  83.          Top             =   1560
  84.          Width           =   975
  85.       End
  86.       Begin Label SharableLabel 
  87.          Height          =   255
  88.          Left            =   4320
  89.          TabIndex        =   30
  90.          Top             =   360
  91.          Width           =   975
  92.       End
  93.       Begin Label SubdirLabel 
  94.          Height          =   255
  95.          Left            =   1800
  96.          TabIndex        =   29
  97.          Top             =   1320
  98.          Width           =   975
  99.       End
  100.       Begin Label ExecuteLabel 
  101.          Height          =   255
  102.          Left            =   1800
  103.          TabIndex        =   28
  104.          Top             =   1080
  105.          Width           =   975
  106.       End
  107.       Begin Label SysLabel 
  108.          Height          =   255
  109.          Left            =   1800
  110.          TabIndex        =   27
  111.          Top             =   840
  112.          Width           =   975
  113.       End
  114.       Begin Label ROLabel 
  115.          Height          =   255
  116.          Left            =   1800
  117.          TabIndex        =   26
  118.          Top             =   360
  119.          Width           =   975
  120.       End
  121.       Begin Label Label20 
  122.          Alignment       =   1  'Right Justify
  123.          Caption         =   "Index:"
  124.          Height          =   255
  125.          Left            =   3360
  126.          TabIndex        =   25
  127.          Top             =   1440
  128.          Width           =   735
  129.       End
  130.       Begin Label Label19 
  131.          Alignment       =   1  'Right Justify
  132.          Caption         =   "Transactional:"
  133.          Height          =   255
  134.          Left            =   2760
  135.          TabIndex        =   24
  136.          Top             =   1200
  137.          Width           =   1335
  138.       End
  139.       Begin Label Label18 
  140.          Alignment       =   1  'Right Justify
  141.          Caption         =   "Search mode:"
  142.          Height          =   255
  143.          Left            =   2880
  144.          TabIndex        =   23
  145.          Top             =   600
  146.          Width           =   1215
  147.       End
  148.       Begin Label Label17 
  149.          Alignment       =   1  'Right Justify
  150.          Caption         =   "Sharable:"
  151.          Height          =   255
  152.          Left            =   3000
  153.          TabIndex        =   22
  154.          Top             =   360
  155.          Width           =   1095
  156.       End
  157.       Begin Label Label16 
  158.          Alignment       =   1  'Right Justify
  159.          Caption         =   "Archive:"
  160.          Height          =   255
  161.          Left            =   720
  162.          TabIndex        =   21
  163.          Top             =   1560
  164.          Width           =   855
  165.       End
  166.       Begin Label Label15 
  167.          Alignment       =   1  'Right Justify
  168.          Caption         =   "Subdirectory:"
  169.          Height          =   255
  170.          Left            =   360
  171.          TabIndex        =   20
  172.          Top             =   1320
  173.          Width           =   1215
  174.       End
  175.       Begin Label Label14 
  176.          Alignment       =   1  'Right Justify
  177.          Caption         =   "Execute-only:"
  178.          Height          =   255
  179.          Left            =   240
  180.          TabIndex        =   19
  181.          Top             =   1080
  182.          Width           =   1335
  183.       End
  184.       Begin Label Label13 
  185.          Alignment       =   1  'Right Justify
  186.          Caption         =   "System:"
  187.          Height          =   255
  188.          Left            =   720
  189.          TabIndex        =   18
  190.          Top             =   840
  191.          Width           =   855
  192.       End
  193.       Begin Label Label12 
  194.          Alignment       =   1  'Right Justify
  195.          Caption         =   "Hidden:"
  196.          Height          =   255
  197.          Left            =   600
  198.          TabIndex        =   17
  199.          Top             =   600
  200.          Width           =   975
  201.       End
  202.       Begin Label HiddenLabel 
  203.          Height          =   255
  204.          Left            =   1800
  205.          TabIndex        =   16
  206.          Top             =   600
  207.          Width           =   975
  208.       End
  209.       Begin Label Label11 
  210.          Alignment       =   1  'Right Justify
  211.          Caption         =   "Read-only:"
  212.          Height          =   255
  213.          Left            =   360
  214.          TabIndex        =   9
  215.          Top             =   360
  216.          Width           =   1215
  217.       End
  218.    End
  219.    Begin CommandButton OKButton 
  220.       Caption         =   "&OK"
  221.       Height          =   495
  222.       Left            =   2880
  223.       TabIndex        =   1
  224.       Top             =   4320
  225.       Width           =   1095
  226.    End
  227.    Begin Label OwnerLabel 
  228.       Height          =   255
  229.       Left            =   2160
  230.       TabIndex        =   13
  231.       Top             =   1080
  232.       Width           =   3735
  233.    End
  234.    Begin Label Label4 
  235.       Alignment       =   1  'Right Justify
  236.       Caption         =   "File Owner:"
  237.       Height          =   255
  238.       Left            =   840
  239.       TabIndex        =   7
  240.       Top             =   1080
  241.       Width           =   1215
  242.    End
  243.    Begin Label LongNameLabel 
  244.       Height          =   255
  245.       Left            =   2160
  246.       TabIndex        =   6
  247.       Top             =   840
  248.       Width           =   4575
  249.    End
  250.    Begin Label Label3 
  251.       Alignment       =   1  'Right Justify
  252.       Caption         =   "Long Name:"
  253.       Height          =   255
  254.       Left            =   720
  255.       TabIndex        =   5
  256.       Top             =   840
  257.       Width           =   1335
  258.    End
  259.    Begin Label Label2 
  260.       Alignment       =   1  'Right Justify
  261.       Caption         =   "Directory:"
  262.       Height          =   255
  263.       Left            =   1080
  264.       TabIndex        =   4
  265.       Top             =   480
  266.       Width           =   975
  267.    End
  268.    Begin Label DirPathLabel 
  269.       Height          =   255
  270.       Left            =   2160
  271.       TabIndex        =   3
  272.       Top             =   480
  273.       Width           =   4575
  274.    End
  275.    Begin Label Label1 
  276.       Alignment       =   1  'Right Justify
  277.       Caption         =   "DOS file name:"
  278.       Height          =   255
  279.       Left            =   720
  280.       TabIndex        =   2
  281.       Top             =   240
  282.       Width           =   1335
  283.    End
  284.    Begin Label FileNameLabel 
  285.       Height          =   255
  286.       Left            =   2160
  287.       TabIndex        =   0
  288.       Top             =   240
  289.       Width           =   1815
  290.    End
  291. Sub Command1_Click ()
  292. End Sub
  293. Sub Form_Load ()
  294.     Dim fileInfo As AFP_FILE_INFO
  295.     server$ = String$(48, 0)
  296.     volume$ = String$(16, 0)
  297.     dirs$ = String$(255, 0)
  298.     afpPath$ = String$(255, 0)
  299.     FileNameLabel.Caption = UCase$(SelectFileForm.FileNameBox.Text)
  300.     DirPathLabel.Caption = UCase$(SelectFileForm.DirBox.Path)
  301.     dirPath$ = DirPathLabel.Caption + "\" + FileNameLabel.Caption
  302.     ccode% = ParsePath(dirPath$, server$, volume$, dirs$)
  303.     server$ = Left$(server$, InStr(server$, Chr$(0)) - 1)
  304.     volume$ = Left$(volume$, InStr(volume$, Chr$(0)) - 1)
  305.     dirs$ = Left$(dirs$, InStr(dirs$, Chr$(0)) - 1)
  306.     dirPath$ = server$ + "/" + volume$ + ":\" + dirs$
  307.     connID% = GetPreferredConnectionID()
  308.     ccode% = AFPDirectoryEntry(connID%, 0, dirPath$)
  309.     If (ccode% = 1) Then
  310.         ccode% = GetVolumeNumber(volume$, volumeNum%)
  311.         ccode% = AFPGetEntryIDFromPathName(connID%, 0, dirPath$, entryID&)
  312.         afpPath$ = Chr$(0)
  313.         ccode% = AFPGetFileInformation(connID%, volumeNum%, entryID&, &HFFFF, afpPath$, Len(fileInfo), fileInfo)
  314.         If (ccode% <> SUCCESSFUL) Then
  315.             MsgBox "Unable to get AFP information on selected file.", MB_OK, "Error"
  316.         Else
  317.             LongNameLabel.Caption = fileInfo.longName
  318.             ownerName$ = String$(48, 0)
  319.             ccode% = GetBinderyObjectName(fileInfo.ownerID, ownerName$, ownerType%)
  320.             If (ccode% = SUCCESSFUL) Then
  321.                 OwnerLabel.Caption = ownerName$
  322.             Else
  323.                 OwnerLabel.Caption = "Unknown User"
  324.             End If
  325.             DataForkLengthLabel.Caption = fileInfo.dataForkLength
  326.             ResourceForkLengthLabel.Caption = fileInfo.resourceForkLength
  327.             If (fileInfo.attributes And &H100) Then
  328.                 ROLabel.Caption = "Yes"
  329.             Else
  330.                 ROLabel.Caption = "No"
  331.             End If
  332.             If (fileInfo.attributes And &H200) Then
  333.                 HiddenLabel.Caption = "Yes"
  334.             Else
  335.                 HiddenLabel.Caption = "No"
  336.             End If
  337.             If (fileInfo.attributes And &H400) Then
  338.                 SysLabel.Caption = "Yes"
  339.             Else
  340.                 SysLabel.Caption = "No"
  341.             End If
  342.             If (fileInfo.attributes And &H800) Then
  343.                 ExecuteLabel.Caption = "Yes"
  344.             Else
  345.                 ExecuteLabel.Caption = "No"
  346.             End If
  347.             If (fileInfo.attributes And &H1000) Then
  348.                 SubdirLabel.Caption = "Yes"
  349.             Else
  350.                 SubdirLabel.Caption = "No"
  351.             End If
  352.             If (fileInfo.attributes And &H2000) Then
  353.                 ArchiveLabel.Caption = "Yes"
  354.             Else
  355.                 ArchiveLabel.Caption = "No"
  356.             End If
  357.             If (fileInfo.attributes And &H8000) Then
  358.                 SharableLabel.Caption = "Yes"
  359.             Else
  360.                 SharableLabel.Caption = "No"
  361.             End If
  362.             If (fileInfo.attributes And &H10) Then
  363.                 TransLabel.Caption = "Yes"
  364.             Else
  365.                 TransLabel.Caption = "No"
  366.             End If
  367.             If (fileInfo.attributes And &H20) Then
  368.                 IndexLabel.Caption = "Yes"
  369.             Else
  370.                 IndexLabel.Caption = "No"
  371.             End If
  372.             If (fileInfo.attributes And 7) = 0 Then
  373.                 SearchLabel.Caption = "No mode"
  374.             ElseIf (fileInfo.attributes And 7) = 1 Then
  375.                 SearchLabel.Caption = "Search on all opens with no path"
  376.             ElseIf (fileInfo.attributes And 7) = 2 Then
  377.                 SearchLabel.Caption = "Do not search"
  378.             ElseIf (fileInfo.attributes And 7) = 3 Then
  379.                 SearchLabel.Caption = "Search on RO opens with no path"
  380.             ElseIf (fileInfo.attributes And 7) = 5 Then
  381.                 SearchLabel.Caption = "Search on all opens"
  382.             ElseIf (fileInfo.attributes And 7) = 7 Then
  383.                 SearchLabel.Caption = "Search on all RO opens"
  384.             Else
  385.                 SearchLabel.Caption = "Unknown"
  386.             End If
  387.         End If
  388.     Else
  389.         LongNameLabel.Caption = "No AFP information (not a Macintosh file)"
  390.     End If
  391. End Sub
  392. Sub OKButton_Click ()
  393.     Unload SelectFileForm
  394.     Unload AFPInfoForm
  395. End Sub
  396.