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

📄 conafilesystem.vb

📁 以前做NOKIA手机与PC通信时所参考的源代码,里面包括两个程序,一个是手机文件夹浏览源码,另一个手机SIS安装程序.
💻 VB
📖 第 1 页 / 共 2 页
字号:
    '	ECONA_CANCELLED
    '	ECONA_FAILED_TIMEOUT
    '	ECONA_UNKNOWN_ERROR_DEVICE
    '	ECONA_NOT_INITIALIZED
    '	ECONA_UNKNOWN_ERROR
    '
    Public Declare Function CONASetCurrentFolder Lib "ConnAPI" (ByVal hFSHandle As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal pstrPath As String) As Integer
    '=========================================================

    '=========================================================
    ' CONAGetCurrentFolder
    '
    ' Description:
    ' CONAGetCurrentFolder returns the current folder, which is 
    ' set by using the CONASetCurrentFolder function.
    '
    ' Parameters:
    '	hFSHandle		[in]  File System handle
    '	ppstrPath		[out] Pointer to the WCHAR receiving 
    '						  the current folder.
    '	
    '
    ' Return values:
    '	CONA_OK
    '	ECONA_INVALID_HANDLE
    '	ECONA_INVALID_POINTER
    '	ECONA_CONNECTION_LOST
    '	ECONA_CANCELLED
    '	ECONA_FAILED_TIMEOUT
    '	ECONA_NOT_INITIALIZED
    '	ECONA_UNKNOWN_ERROR	
    '
    Public Declare Function CONAGetCurrentFolder Lib "ConnAPI" (ByVal hFSHandle As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByRef ppstrPath As String) As Integer
    '=========================================================

    '=========================================================
    ' CONAFindBegin
    '
    ' Description:
    ' CONAFindBegin starts find files and subfolders from currect 
    ' folder or target path. If target path is used, path must be 
    ' absolute path.Find option:
    ' CONA_FIND_USE_CACHE	  Use cache if it is available.
    '
    ' Parameters:
    '	hFSHandle		[in]  File System handle
    '	iFindOptions	[in]  Find options:If CONA_FIND_USE_CACHE option
    '						  is not used, value must be 0.
    '	pFileHandle		[out] Pointer to find handle
    '	pstrTargetPath	[in]  Target path. If the path is NULL, 
    '						  the current folder is used 
    '
    ' Return values:
    '	CONA_OK
    '	ECONA_INVALID_HANDLE
    '	ECONA_INVALID_PARAMETER
    '	ECONA_INVALID_POINTER
    '	ECONA_CONNECTION_BUSY
    '	ECONA_CONNECTION_LOST
    '	ECONA_INVALID_DATA_DEVICE
    '	ECONA_CURRENT_FOLDER_NOT_FOUND
    '	ECONA_CANCELLED
    '	ECONA_FAILED_TIMEOUT
    '	ECONA_UNKNOWN_ERROR_DEVICE
    '	ECONA_NOT_INITIALIZED
    '  ECONA_NOT_ENOUGH_MEMORY
    '	ECONA_UNKNOWN_ERROR
    '	ECONA_FOLDER_PATH_TOO_LONG
    '	ECONA_FOLDER_NAME_INVALID_DEVICE
    '	ECONA_FOLDER_NO_PERMISSION
    '
    Public Declare Function CONAFindBegin Lib "ConnAPI" (ByVal hFSHandle As Integer, ByVal iFindOptions As Integer, ByRef phFindHandle As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal pstrTargetPath As String) As Integer
    '=========================================================

    '=========================================================
    ' CONAFindNextFolder
    '
    ' Description:
    ' CONAFindNextFolder returns the folder information for one 
    ' folder and continues the search to the next folder. The 
    ' folder information is returned with the CONAPI_FOLDER_INFO 
    ' structure. The allocated memory MUST be freed by calling 
    ' the CONAFreeFolderInfoStructure function.
    '
    ' Parameters:
    '	hFindHandle		[in]  Find handle
    '	pFolderInfo		[out] Pointer to the folder's info struct.
    '
    ' Return values:
    '	CONA_OK
    '	ECONA_ALL_LISTED
    '	ECONA_INVALID_HANDLE
    '	ECONA_INVALID_POINTER
    '	ECONA_NOT_INITIALIZED
    '	ECONA_UNKNOWN_ERROR
    '
    Public Declare Function CONAFindNextFolder Lib "ConnAPI" (ByVal hFindHandle As Integer, ByVal pFolderInfo As IntPtr) As Integer
    '=========================================================

    '=========================================================
    ' CONAFindNextFile
    '
    ' Description:
    ' CONAFindNextFile returns file information for one file, 
    ' and continues the search to the next file. File information 
    ' is returned with the CONAPI_FILE_INFO structure. Allocated 
    ' memory MUST be freed by calling CONAFreeFileInfoStructure function.
    '
    ' Parameters:
    '	hFindHandle		[in]  Find handle
    '	pFileInfo		[out] Pointer to the file's info struct.
    '
    ' Return values:
    '	CONA_OK
    '	ECONA_ALL_LISTED
    '	ECONA_INVALID_HANDLE
    '	ECONA_INVALID_POINTER
    '	ECONA_NOT_INITIALIZED
    '	ECONA_UNKNOWN_ERROR
    '
    Public Declare Function CONAFindNextFile Lib "ConnAPI" (ByVal hFindHandle As Integer, ByVal pFileInfo As IntPtr) As Integer
    '=========================================================

    '=========================================================
    ' CONAFindEnd
    '
    ' Description:
    ' CONAFindEnd closes find handle.
    '
    '
    ' Parameters:
    '	hFindHandle		[in]  Find handle
    '
    ' Return values:
    '	CONA_OK
    '	ECONA_INVALID_HANDLE
    '
    Public Declare Function CONAFindEnd Lib "ConnAPI" (ByVal hFindHandle As Integer) As Integer
    '=========================================================

    '=========================================================
    ' CONACreateFolder
    '
    ' Description:
    ' CONACreateFolder creates a new folder onto the device. 
    ' The function fails if the folder already exists on the device.
    '
    ' Parameters:
    '	hFSHandle		[in] File System handle
    '	pstrFolderName	[in] New folder name string
    '	pstrTargetPath	[in] Target path. If path is NULL, current 
    '						 folder is used. 
    '
    ' Return values:
    '	CONA_OK
    '	ECONA_INVALID_HANDLE
    '	ECONA_INVALID_PARAMETER
    '	ECONA_CONNECTION_BUSY
    '	ECONA_CONNECTION_LOST
    '	ECONA_INVALID_DATA_DEVICE
    '	ECONA_CURRENT_FOLDER_NOT_FOUND
    '	ECONA_FOLDER_PATH_TOO_LONG
    '	ECONA_FOLDER_NAME_INVALID_DEVICE
    '	ECONA_FOLDER_ALREADY_EXIST
    '	ECONA_FOLDER_NO_PERMISSION
    '	ECONA_CANCELLED
    '	ECONA_FAILED_TIMEOUT
    '	ECONA_UNKNOWN_ERROR_DEVICE
    '	ECONA_NOT_INITIALIZED
    '	ECONA_UNKNOWN_ERROR
    '
    Public Declare Function CONACreateFolder Lib "ConnAPI" (ByVal hFSHandle As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal pstrFolderName As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal pstrTargetPath As String) As Integer
    '=========================================================

    '=========================================================
    ' CONADeleteFolder
    '
    ' Description:
    ' CONADeleteFolder deletes a folder from the device. This 
    ' function does not delete the folder if the folder includes 
    ' any subfolder(s)! Only an empty folder and a folder that 
    ' contains files can be deleted. If the folder does not include 
    ' a DELETE-permission, the function fails.
    '
    ' Note: No rollback option! Deleted data cannot be restored!
    '
    ' Parameters:
    '	hFSHandle		[in] File System handle
    '	pstrFolderName	[in] Folder name string
    '	iDeleteOptions	[in] Delete options. Possible values: 
    '			CONA_DELETE_FOLDER_EMPTY:		Only an empty folder can be deleted.
    '			CONA_DELETE_FOLDER_WITH_FILES:  Only a folder that contains file(s) can be deleted.
    '	pstrTargetPath	[in] Target path. If path is NULL, current
    '						 folder is used.  
    '
    ' Return values:
    '	CONA_OK
    '	ECONA_INVALID_HANDLE
    '	ECONA_INVALID_PARAMETER
    '	ECONA_CONNECTION_BUSY
    '	ECONA_CONNECTION_LOST
    '	ECONA_INVALID_DATA_DEVICE
    '	ECONA_CURRENT_FOLDER_NOT_FOUND
    '	ECONA_FOLDER_PATH_TOO_LONG
    '	ECONA_FOLDER_NOT_FOUND
    '	ECONA_FOLDER_NOT_EMPTY
    '	ECONA_FOLDER_NO_PERMISSION
    '	ECONA_CANCELLED
    '	ECONA_FAILED_TIMEOUT
    '	ECONA_UNKNOWN_ERROR_DEVICE
    '	ECONA_NOT_INITIALIZED
    '	ECONA_UNKNOWN_ERROR
    '
    Public Declare Function CONADeleteFolder Lib "ConnAPI" (ByVal hFSHandle As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal pstrFolderName As String, ByVal iDeleteOptions As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal pstrTargetPath As String) As Integer
    '=========================================================

    '=========================================================
    ' CONARenameFolder
    '
    ' Description:
    ' CONARenameFolder renames a folder on the device. Only an 
    ' empty folder can be renamed at the moment.

    '
    ' Parameters:
    '	hFSHandle		  [in] File System handle
    '	pstrFolderName	  [in] Folder name string.
    '	pstrFolderNameNew [in] Folder's new name string.
    '	pstrTargetPath	  [in] Target path. If the path is NULL, 
    '                         current folder is used. 
    '
    ' Return values:
    '	CONA_OK
    '	ECONA_INVALID_HANDLE
    '	ECONA_INVALID_PARAMETER
    '	ECONA_CONNECTION_BUSY
    '	ECONA_CONNECTION_LOST
    '	ECONA_INVALID_DATA_DEVICE
    '	ECONA_CURRENT_FOLDER_NOT_FOUND
    '  ECONA_FOLDER_PATH_TOO_LONG
    '	ECONA_FOLDER_ALREADY_EXIST
    '	ECONA_FOLDER_NOT_FOUND
    '	ECONA_FOLDER_NOT_EMPTY
    '	ECONA_FOLDER_NO_PERMISSION
    '	ECONA_CANCELLED
    '	ECONA_FAILED_TIMEOUT
    '	ECONA_UNKNOWN_ERROR_DEVICE
    '	ECONA_NOT_INITIALIZED
    '	ECONA_UNKNOWN_ERROR
    '
    Public Declare Function CONARenameFolder Lib "ConnAPI" (ByVal hFSHandle As Integer, <MarshalAs(UnmanagedType.LPWStr)> ByVal pstrFolderName As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal pstrFolderNameNew As String, <MarshalAs(UnmanagedType.LPWStr)> ByVal pstrTargetPath As String) As Integer
    '=========================================================
    '
    '=========================================================
    ' CONAGetFolderInfo
    '
    ' Description:
    ' CONAGetFolderInfo sets required information to  
    ' CONAPI_FOLDER_CONTENT structure. The Connectivity API-user 
    ' MUST initialize the CONAPI_FOLDER_CONTENT structure before 
    ' calling this function!
    '
    ' When option CONA_GET_FOLDER_INFO is used, it adds the next
    ' data to CONAPI_FOLDER_CONTENT structure:
    '		CONAPI_FOLDER_INFO2 structure from target folder. The 
    '		number of files and folders in target folder and total 
    '		size of folder content are not set.
    '
    ' When option CONA_GET_FOLDER_CONTENT is used, it adds the 
    ' next data to CONAPI_FOLDER_CONTENT structure:
    '		CONAPI_FOLDER_INFO2 structure from target folder. The 
    '		number of files and folders in target folder and total 
    '		size of folder content are not set.
    '		CONAPI_FILE_INFO structure(s) from file(s), which 
    '		are in target folder.
    '		CONAPI_FOLDER_CONTENT structure(s) from sub folder(s), 
    '		which are in target folder. Every structure includes 
    '		only CONAPI_FOLDER_INFO2 structure.
    '
    ' When option CONA_GET_FOLDER_AND_SUB_FOLDERS_CONTENT is used, 
    ' it adds the next data to CONAPI_FOLDER_CONTENT structure:
    '		CONAPI_FILE_INFO structure(s) from file(s), which 
    '		are in target folder.
    '		CONAPI_FOLDER_CONTENT structure(s) from sub folder(s), 
    '		which are in target folder. Every structure includes 
    '		CONAPI_FOLDER_INFO2 structure. If sub folder(s) contain
    '		file(s) or/and folder(s) those are also included. 
    '
    ' Allocated memory must be freed by calling the 
    ' CONAFreeFolderContentStructure function.
    ' 
    '
    ' Parameters:
    '	hFSHandle		[in]  File System handle
    '	dwOptions		[in]  Get folder info options:
    '		CONAPI_ALLOW_TO_USE_CACHE:	If the cached folder data 
    '			is available, it will be used. This value is  
    '			optional and can be used with other values.
    '		CONA_COMPARE_AND_UPDATE_IF_NEEDED: Compare given folder 
    '			content structure and returns one of the value:
    '			CONA_OK: Structure is not updated because it 
    '				is up-to-date.
    '			CONA_OK_UPDATED_MEMORY_VALUES: Structure is updated 
    '				because of free, used and total memory values 
    '				are updated.
    '			CONA_OK_UPDATED_MEMORY_AND_FILES: Structure is 
    '				updated because of file(s) and memory values 
    '				are updated.
    '			CONA_OK_UPDATED: Structure is updated, unknown reason. 
    '			This value is optional and can be used with other values.
    '		The next values must be used one at a time:
    '			CONA_GET_FOLDER_INFO
    '			CONA_GET_FOLDER_CONTENT
    '			CONA_GET_FOLDER_AND_SUB_FOLDERS_CONTENT
    '	pstrFolderName	[in] Name of target folder or drive. This value
    '		can be NULL. If target folder is device抯 root folder, value 
    '		must include an empty string or NULL and target (or the 
    '		current folder) path must be 揬\

⌨️ 快捷键说明

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