home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / afpinfo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-07  |  13.2 KB  |  400 lines

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