Results 1 to 4 of 4

Thread: Display List of files on Ipaq using PC VB.Net program [Resolved]

  1. #1

    Thread Starter
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Display List of files on Ipaq using PC VB.Net program [Resolved]

    Is this even remotely possible?

    ANy help will be immensely appreceiated!
    Last edited by dinosaur_uk; Jul 6th, 2005 at 09:10 AM.

  2. #2

    Thread Starter
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Arrow Re: Display List of files on Ipaq using PC VB.Net program

    OK...i have progressed abit further now. If i change root to "\SD Card"
    it does not display what is on the sd card.

    ANy ideas?


    VB Code:
    1. Private Sub btnFileList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFileList.Click
    2.         Try
    3.             Dim m_rapi As RAPI
    4.             m_rapi = New RAPI
    5.             Try
    6.                 Dim filelist As OpenNETCF.Desktop.Communication.FileList
    7.                 Dim root As String = "*"
    8.                 m_rapi.Connect(True, 10)
    9.                 filelist = m_rapi.EnumFiles(root)
    10.                 Dim i, j As Integer
    11.                 For i = 0 To filelist.Count - 1
    12.                     ListBox1.Items.Add(filelist(i).FileName)
    13.                 Next
    14.                 m_rapi.Disconnect()
    15.             Catch ex As Exception
    16.                 MessageBox.Show("Error encountered when updating device." + vbCrLf + ex.ToString, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
    17.             End Try
    18.         Catch ex As Exception
    19.             MsgBox(ex.ToString)
    20.         End Try
    21.     End Sub

  3. #3
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Display List of files on Ipaq using PC VB.Net program

    here what i done before

    VB Code:
    1. Private Sub LoadTreeView()
    2.         ppcFileView.ShowPlusMinus = True
    3.         Try
    4.             Dim l_deviceFileList As FileList
    5.             l_deviceFileList = m_rapi.EnumFiles("\*")
    6.  
    7.             For Each f As FileInformation In l_deviceFileList
    8.                 ppcFileView.Nodes.Add(f.FileName)
    9.             Next
    10.             For Each n As TreeNode In ppcFileView.Nodes
    11.                 Dim subInfo As FileList
    12.                 subInfo = m_rapi.EnumFiles("\" & n.Text & "\*")
    13.                 If Not subInfo Is Nothing Then
    14.                     For Each f As FileInformation In subInfo
    15.                         ppcFileView.Nodes(n.Index).Nodes.Add(f.FileName)
    16.                     Next
    17.                 End If
    18.             Next
    19.  
    20.         Catch ex As RAPIException
    21.             MsgBox(ex.Message, MsgBoxStyle.Exclamation, "ManoSync Pro")
    22.         End Try
    23.     End Sub
    24.  
    25.     Private Sub LoadTopFiles()
    26.         ppcFileView.ShowPlusMinus = True
    27.         Try
    28.             Dim l_deviceFileList As FileList
    29.             l_deviceFileList = m_rapi.EnumFiles("\*")
    30.  
    31.             For Each f As FileInformation In l_deviceFileList
    32.                 Dim l_oNode As New TreeNode
    33.                 l_oNode.Text = f.FileName
    34.                 ppcFileView.Nodes.Add(l_oNode)
    35.                 l_oNode.Nodes.Add("")
    36.             Next
    37.         Catch ex As RAPIException
    38.             MsgBox(ex.Message, MsgBoxStyle.Exclamation, "ManoSync Pro")
    39.         End Try
    40.     End Sub
    41.  
    42.     Private Sub ppcFileView_BeforeExpand(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles ppcFileView.BeforeExpand
    43.         If e.Node.ImageIndex = 2 Then Exit Sub
    44.         'MsgBox(e.Node.FullPath)
    45.         Try
    46.             If e.Node.GetNodeCount(False) = 1 And e.Node.Nodes(0).Text = "" Then
    47.                 e.Node.Nodes(0).Remove()
    48.                 EnumerateChildren(e.Node)
    49.             End If
    50.         Catch ex As Exception
    51.             MsgBox("Unable to expand " & e.Node.FullPath & ":" & ex.ToString)
    52.         End Try
    53.  
    54.         If e.Node.GetNodeCount(False) > 0 Then
    55.             e.Node.ImageIndex = 1
    56.             e.Node.SelectedImageIndex = 1
    57.         End If
    58.     End Sub
    59.  
    60.     Private Sub EnumerateChildren(ByVal p_nodeParent As TreeNode)
    61.         If Not p_nodeParent Is Nothing Then
    62.             Try
    63.                 Dim l_deviceFileList As FileList
    64.                 'get the directory filelist
    65.                 l_deviceFileList = m_rapi.EnumFiles("\" & p_nodeParent.FullPath & "\*")
    66.  
    67.                 'check if empty folder
    68.                 If Not l_deviceFileList Is Nothing Then
    69.                     'check if file or directory
    70.                     If InStr(p_nodeParent.Text, ".", CompareMethod.Text) = 0 Then
    71.                         For Each f As FileInformation In l_deviceFileList
    72.                             Dim l_oNode As New TreeNode
    73.                             l_oNode.Text = f.FileName
    74.  
    75.                             If InStr(f.FileName, ".", CompareMethod.Text) = 0 Then
    76.                                 l_oNode.ImageIndex = 0
    77.                                 l_oNode.SelectedImageIndex = 0
    78.                             Else
    79.                                 l_oNode.ImageIndex = 1
    80.                                 l_oNode.SelectedImageIndex = 1
    81.                             End If
    82.  
    83.                             p_nodeParent.Nodes.Add(l_oNode)
    84.                             l_oNode.Nodes.Add("")
    85.                         Next
    86.                     End If
    87.                 End If
    88.             Catch ex As RAPIException
    89.                 MsgBox(ex.Message, MsgBoxStyle.Exclamation, "ManoSync Pro")
    90.             End Try
    91.         End If
    92.     End Sub
    93.  
    94.     Private Sub ppcFileView_BeforeCollapse(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles ppcFileView.BeforeCollapse
    95.         e.Node.ImageIndex = 0
    96.         e.Node.SelectedImageIndex = 0
    97.     End Sub
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  4. #4

    Thread Starter
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: Display List of files on Ipaq using PC VB.Net program [Resolved]

    How do i get the path of selected file/s ? How do get the full path names of the selected items in order to copy them.

    is is something like ppcFileView.SelectedNode.Text ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width