⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filebrowser.vb

📁 以前做NOKIA手机与PC通信时所参考的源代码,里面包括两个程序,一个是手机文件夹浏览源码,另一个手机SIS安装程序.
💻 VB
📖 第 1 页 / 共 4 页
字号:
'Filename    : FileBrowser.vb
'Part of     : Phone Navigator VB.NET example
'Description : Main dialog of VBFileBrowser.NET example application
'Version     : 3.2
'
'This example is only to be used with PC Connectivity API version 3.2.
'Compability ("as is") with future versions is not quaranteed.
'
'Copyright (c) 2005-2007 Nokia Corporation.
'
'This material, including but not limited to documentation and any related
'computer programs, is protected by intellectual property rights of Nokia
'Corporation and/or its licensors.
'All rights are reserved. Reproducing, modifying, translating, or
'distributing any or all of this material requires the prior written consent
'of Nokia Corporation. Nokia Corporation retains the right to make changes
'to this material at any time without notice. A copyright license is hereby
'granted to download and print a copy of this material for personal use only.
'No other license to any other intellectual property rights is granted. The
'material is provided "as is" without warranty of any kind, either express or
'implied, including without limitation, any warranty of non-infringement,
'merchantability and fitness for a particular purpose. In no event shall
'Nokia Corporation be liable for any direct, indirect, special, incidental,
'or consequential loss or damages, including but not limited to, lost profits
'or revenue,loss of use, cost of substitute program, or loss of data or
'equipment arising out of the use or inability to use the material, even if
'Nokia Corporation has been advised of the likelihood of such damages occurring.

Imports System.Runtime.InteropServices

Public Class FileBrowser
    Inherits System.Windows.Forms.Form

    Private m_bCancelled As Boolean
    Friend WithEvents Timer1 As System.Windows.Forms.Timer
    Private m_bDisposed As Boolean = False
    Friend WithEvents CheckBoxUseCache As System.Windows.Forms.CheckBox
    Friend WithEvents BTN_ItemInfo As System.Windows.Forms.Button
    Public bRefreshPhoneListBox As Boolean = False

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()
        ' Initialize Nokia PC Suite Connectivity API

        ' Initialize Device Management APi
        Dim iRet As Integer = DMAPI_Initialize(DMAPI_VERSION_32, vbNullString)
        If iRet <> CONA_OK Then ShowErrorMessage("DMAPI_Initialize", iRet)
        ' Initialize File System API
        iRet = FSAPI_Initialize(FSAPI_VERSION_32, vbNullString)
        If iRet <> CONA_OK Then ShowErrorMessage("FSAPI_Initialize", iRet)

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call
    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If Not m_bDisposed Then
            MyBase.Dispose(disposing)
        End If
        m_bDisposed = True
        ' Terminate Device Management APi
        Dim iRet As Integer = DMAPI_Terminate(0)
        If iRet <> CONA_OK Then ShowErrorMessage("DMAPI_Terminate", iRet)
        ' Terminate File Ssytem API
        iRet = FSAPI_Terminate(0)
        If iRet <> CONA_OK Then ShowErrorMessage("FSAPI_Terminate", iRet)
        Application.Exit()
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents LBX_PCFiles As FileListBox
    Friend WithEvents LBX_PhoneFiles As PhoneListBox
    Friend WithEvents BTN_CopyPCToPhone As System.Windows.Forms.Button
    Friend WithEvents BTN_CopyPhoneToPC As System.Windows.Forms.Button
    Friend WithEvents BTN_MovePCToPhone As System.Windows.Forms.Button
    Friend WithEvents BTN_MovePhoneToPC As System.Windows.Forms.Button
    Friend WithEvents BTN_Close As System.Windows.Forms.Button
    Friend WithEvents BTN_Delete As System.Windows.Forms.Button
    Friend WithEvents BTN_Rename As System.Windows.Forms.Button
    Friend WithEvents BTN_Create As System.Windows.Forms.Button
    Friend WithEvents LBL_PCFiles As System.Windows.Forms.Label
    Friend WithEvents LBL_PhoneFiles As System.Windows.Forms.Label
    Friend WithEvents BTN_Cancel As System.Windows.Forms.Button
    Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FileBrowser))
        Me.BTN_CopyPCToPhone = New System.Windows.Forms.Button
        Me.BTN_CopyPhoneToPC = New System.Windows.Forms.Button
        Me.BTN_MovePCToPhone = New System.Windows.Forms.Button
        Me.BTN_MovePhoneToPC = New System.Windows.Forms.Button
        Me.BTN_Close = New System.Windows.Forms.Button
        Me.BTN_Delete = New System.Windows.Forms.Button
        Me.BTN_Rename = New System.Windows.Forms.Button
        Me.BTN_Create = New System.Windows.Forms.Button
        Me.LBL_PCFiles = New System.Windows.Forms.Label
        Me.LBL_PhoneFiles = New System.Windows.Forms.Label
        Me.BTN_Cancel = New System.Windows.Forms.Button
        Me.ProgressBar1 = New System.Windows.Forms.ProgressBar
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.CheckBoxUseCache = New System.Windows.Forms.CheckBox
        Me.BTN_ItemInfo = New System.Windows.Forms.Button
        Me.LBX_PCFiles = New VBFileBrowser.NET.FileListBox
        Me.LBX_PhoneFiles = New VBFileBrowser.NET.PhoneListBox
        Me.SuspendLayout()
        '
        'BTN_CopyPCToPhone
        '
        Me.BTN_CopyPCToPhone.Location = New System.Drawing.Point(253, 25)
        Me.BTN_CopyPCToPhone.Name = "BTN_CopyPCToPhone"
        Me.BTN_CopyPCToPhone.Size = New System.Drawing.Size(80, 24)
        Me.BTN_CopyPCToPhone.TabIndex = 2
        Me.BTN_CopyPCToPhone.Text = "Copy >>"
        '
        'BTN_CopyPhoneToPC
        '
        Me.BTN_CopyPhoneToPC.Location = New System.Drawing.Point(253, 55)
        Me.BTN_CopyPhoneToPC.Name = "BTN_CopyPhoneToPC"
        Me.BTN_CopyPhoneToPC.Size = New System.Drawing.Size(80, 24)
        Me.BTN_CopyPhoneToPC.TabIndex = 3
        Me.BTN_CopyPhoneToPC.Text = "<< Copy"
        '
        'BTN_MovePCToPhone
        '
        Me.BTN_MovePCToPhone.Location = New System.Drawing.Point(253, 85)
        Me.BTN_MovePCToPhone.Name = "BTN_MovePCToPhone"
        Me.BTN_MovePCToPhone.Size = New System.Drawing.Size(80, 24)
        Me.BTN_MovePCToPhone.TabIndex = 4
        Me.BTN_MovePCToPhone.Text = "Move >>"
        '
        'BTN_MovePhoneToPC
        '
        Me.BTN_MovePhoneToPC.Location = New System.Drawing.Point(253, 115)
        Me.BTN_MovePhoneToPC.Name = "BTN_MovePhoneToPC"
        Me.BTN_MovePhoneToPC.Size = New System.Drawing.Size(80, 24)
        Me.BTN_MovePhoneToPC.TabIndex = 5
        Me.BTN_MovePhoneToPC.Text = "<< Move"
        '
        'BTN_Close
        '
        Me.BTN_Close.Location = New System.Drawing.Point(253, 250)
        Me.BTN_Close.Name = "BTN_Close"
        Me.BTN_Close.Size = New System.Drawing.Size(80, 24)
        Me.BTN_Close.TabIndex = 6
        Me.BTN_Close.Text = "Close"
        '
        'BTN_Delete
        '
        Me.BTN_Delete.Location = New System.Drawing.Point(512, 288)
        Me.BTN_Delete.Name = "BTN_Delete"
        Me.BTN_Delete.Size = New System.Drawing.Size(72, 24)
        Me.BTN_Delete.TabIndex = 7
        Me.BTN_Delete.Text = "Delete"
        '
        'BTN_Rename
        '
        Me.BTN_Rename.Location = New System.Drawing.Point(428, 288)
        Me.BTN_Rename.Name = "BTN_Rename"
        Me.BTN_Rename.Size = New System.Drawing.Size(72, 24)
        Me.BTN_Rename.TabIndex = 8
        Me.BTN_Rename.Text = "Rename"
        '
        'BTN_Create
        '
        Me.BTN_Create.Location = New System.Drawing.Point(344, 288)
        Me.BTN_Create.Name = "BTN_Create"
        Me.BTN_Create.Size = New System.Drawing.Size(72, 24)
        Me.BTN_Create.TabIndex = 9
        Me.BTN_Create.Text = "Create"
        '
        'LBL_PCFiles
        '
        Me.LBL_PCFiles.Location = New System.Drawing.Point(8, 8)
        Me.LBL_PCFiles.Name = "LBL_PCFiles"
        Me.LBL_PCFiles.Size = New System.Drawing.Size(320, 16)
        Me.LBL_PCFiles.TabIndex = 10
        Me.LBL_PCFiles.Text = "Local folders:"
        '
        'LBL_PhoneFiles
        '
        Me.LBL_PhoneFiles.Location = New System.Drawing.Point(344, 8)
        Me.LBL_PhoneFiles.Name = "LBL_PhoneFiles"
        Me.LBL_PhoneFiles.Size = New System.Drawing.Size(232, 16)
        Me.LBL_PhoneFiles.TabIndex = 11
        Me.LBL_PhoneFiles.Text = "Connected Devices:"
        '
        'BTN_Cancel
        '
        Me.BTN_Cancel.Location = New System.Drawing.Point(253, 219)
        Me.BTN_Cancel.Name = "BTN_Cancel"
        Me.BTN_Cancel.Size = New System.Drawing.Size(80, 24)
        Me.BTN_Cancel.TabIndex = 12
        Me.BTN_Cancel.Text = "Cancel"
        Me.BTN_Cancel.Visible = False
        '
        'ProgressBar1
        '
        Me.ProgressBar1.Location = New System.Drawing.Point(8, 288)
        Me.ProgressBar1.Name = "ProgressBar1"
        Me.ProgressBar1.Size = New System.Drawing.Size(656, 16)
        Me.ProgressBar1.TabIndex = 13
        Me.ProgressBar1.Visible = False
        '
        'Timer1
        '
        '
        'CheckBoxUseCache
        '
        Me.CheckBoxUseCache.AutoSize = True
        Me.CheckBoxUseCache.Location = New System.Drawing.Point(253, 292)
        Me.CheckBoxUseCache.Name = "CheckBoxUseCache"
        Me.CheckBoxUseCache.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.CheckBoxUseCache.Size = New System.Drawing.Size(78, 17)
        Me.CheckBoxUseCache.TabIndex = 14
        Me.CheckBoxUseCache.Text = "Use cache"
        Me.CheckBoxUseCache.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        Me.CheckBoxUseCache.UseVisualStyleBackColor = True
        '
        'BTN_ItemInfo
        '
        Me.BTN_ItemInfo.Location = New System.Drawing.Point(597, 288)
        Me.BTN_ItemInfo.Name = "BTN_ItemInfo"
        Me.BTN_ItemInfo.Size = New System.Drawing.Size(72, 24)
        Me.BTN_ItemInfo.TabIndex = 15
        Me.BTN_ItemInfo.Text = "Item info"
        Me.BTN_ItemInfo.UseVisualStyleBackColor = True
        '
        'LBX_PCFiles
        '
        Me.LBX_PCFiles.Location = New System.Drawing.Point(8, 24)
        Me.LBX_PCFiles.Name = "LBX_PCFiles"
        Me.LBX_PCFiles.Size = New System.Drawing.Size(232, 251)
        Me.LBX_PCFiles.TabIndex = 0
        '
        'LBX_PhoneFiles
        '
        Me.LBX_PhoneFiles.Location = New System.Drawing.Point(344, 24)
        Me.LBX_PhoneFiles.Name = "LBX_PhoneFiles"
        Me.LBX_PhoneFiles.Size = New System.Drawing.Size(327, 251)
        Me.LBX_PhoneFiles.TabIndex = 0
        '
        'FileBrowser

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -