亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? phonelistbox.cs

?? 以前做NOKIA手機與PC通信時所參考的源代碼,里面包括兩個程序,一個是手機文件夾瀏覽源碼,另一個手機SIS安裝程序.
?? CS
?? 第 1 頁 / 共 2 頁
字號:
//Filename    : PhoneListBox.cs
//Part of     : Phone Navigator C# example
//Description : Implementation of phone navigator's phone list box
//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) 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.

using System;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Windows.Forms;
using System.IO;
namespace CSFileBrowser.NET
{
    using PCCSErrors;
    using PCCAPIUtils;
    using CONADefinitions;
    using CONADeviceManagement;
    using CONAFileSystem;

    //===================================================================
    // PhoneListBox
    public class PhoneListBox : System.Windows.Forms.ListBox
    {

        // "\\" means phone root
        const string g_strPhoneRoot = "\\\\";

        private bool bDisposed = false;
        private int m_wState;
        private string m_strCurrentFolder;
        private string m_strCurrentSN;
        private string m_strCurrentFriendlyName;
        private string[] ItemData;
        // Device management handle
        private int m_hDMHandle;
        private CONADefinitions.DeviceNotifyCallbackDelegate pfnCallBack;
        private string[] m_strSerialNumbers;
        private string[] m_strFriendlyNames;
        [MarshalAs(UnmanagedType.LPWStr)]
        string pstrMemoryTypes;

        //===================================================================
        // Constructor
        //
        //===================================================================
        public PhoneListBox()
        {
            int ret;

            // Initialize Device Management APi
            int iRet = CONADeviceManagement.DMAPI_Initialize(CONADeviceManagement.DMAPI_VERSION_32, 0);
            if (iRet != PCCSErrors.CONA_OK) PCCAPIUtils.ShowErrorMessage("DMAPI_Initialize", iRet);

            m_strCurrentFolder = "";
            // Get Device management handle
            ret = CONADeviceManagement.CONAOpenDM(ref m_hDMHandle);
            if (ret != PCCSErrors.CONA_OK) PCCAPIUtils.ShowErrorMessage("CONAOpenDM", ret);
            // Register device notification callback function
            Common.pDeviceCallBack = Common.DeviceNotifyCallback;
            ret = CONADeviceManagement.CONARegisterNotifyCallback(m_hDMHandle, CONADefinitions.API_REGISTER, Common.pDeviceCallBack);
            if (ret != PCCSErrors.CONA_OK) PCCAPIUtils.ShowErrorMessage("CONARegisterNotifyCallback", ret);
        }

        //===================================================================
        // Destructor
        //
        //===================================================================
        protected override void Dispose(bool disposing)
        {
            int ret;

            if (!bDisposed)
            {
                if (m_hDMHandle != 0)
                {
                    // Unregister device notification callback function
                    ret = CONADeviceManagement.CONARegisterNotifyCallback(m_hDMHandle, CONADefinitions.API_UNREGISTER, Common.pDeviceCallBack);
                    if (ret != PCCSErrors.CONA_OK) PCCAPIUtils.ShowErrorMessage("CONARegisterNotifyCallback", ret);
                    // Close device management handle
                    ret = CONADeviceManagement.CONACloseDM(m_hDMHandle);
                    if (ret != PCCSErrors.CONA_OK) PCCAPIUtils.ShowErrorMessage("CONACloseDM", ret);
                }
                // Terminate Device Management APi
                int iRet = CONADeviceManagement.DMAPI_Terminate(0);
                if (iRet != PCCSErrors.CONA_OK) PCCAPIUtils.ShowErrorMessage("DMAPI_Terminate", iRet);

                base.Dispose(disposing);
            }
            bDisposed = true;
        }

        //===================================================================
        // PhoneListBox_DoubleClick
        //
        // Called when user doubleclicks list item
        // If state = PHONE_LIST 
        //  Show phone file system root
        // Else 
        //  If item is [..], shows parent folder (if root change to phone list)
        //  If item is [foldername], shows subfolder
        // 
        //===================================================================
        protected override void OnDoubleClick(EventArgs e)
        {
            if (m_wState == Common.PHONELIST_STATE_PHONELIST)
            {
                m_strCurrentSN = GetCurrentSN();
                m_strCurrentFriendlyName = GetCurrentFriendlyName();
                if (m_strCurrentSN.Length > 0)
                {
                    ResetContent();
                    // removing phones
                    m_wState = Common.PHONELIST_STATE_PHONECONTENT;
                    ShowPhoneFolder(g_strPhoneRoot);
                }
            }
            else if (m_wState == Common.PHONELIST_STATE_PHONECONTENT)
            {

                string strSelectedTxt;
                string strCurrentFolder;
                int index = SelectedIndex;
                if (index != -1)
                {
                    strSelectedTxt = Items[SelectedIndex].ToString();
                    if (strSelectedTxt == "[..]")
                    {
                        // go up in folder tree
                        strCurrentFolder = GetSelectedFolder();
                        if (strCurrentFolder == g_strPhoneRoot)
                        {
                            // root folder --> show phone list
                            ResetContent();
                            m_strCurrentFolder = "";
                            m_wState = Common.PHONELIST_STATE_PHONELIST;
                            ListAllPhones();
                        }
                        else
                        {
                            // getting parent folder of strCurrentFolder:
                            if (strCurrentFolder != g_strPhoneRoot)
                            {
                                strCurrentFolder = strCurrentFolder.Substring(0, strCurrentFolder.LastIndexOf("\\"));
                                if (strCurrentFolder == "\\")
                                {
                                    // move to root folder
                                    strCurrentFolder = g_strPhoneRoot;
                                }
                            }
                            ShowPhoneFolder(strCurrentFolder);
                        }
                    }
                    else if (strSelectedTxt.Substring(0, 1) == "[")
                    {
                        // selected item is folder
                        ShowPhoneFolder(GetSelectedFolder());
                    }
                    else
                    {
                        // selected item is file
                        Trace.WriteLine("PhoneListBox::PhoneItemDblClicked(): Double clicked file %s --> ignoring...\\n", strSelectedTxt);
                    }
                }
            }
        }

        //===================================================================
        // ShowFolders
        //
        // Adds all found folders to listbox by using CONAFindNextFolder.
        // 
        //===================================================================
        public void ShowFolders(int hFindHandle)
        {
            CONADefinitions.CONAPI_FOLDER_INFO FolderInfo;
            int iResult = 0;
            // Allocate memory for buffer
            IntPtr Buffer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CONADefinitions.CONAPI_FOLDER_INFO)));
            iResult = CONAFileSystem.CONAFindNextFolder(hFindHandle, Buffer);
            while (iResult == PCCSErrors.CONA_OK)
            {
                // Copy data from buffer
                FolderInfo = (CONADefinitions.CONAPI_FOLDER_INFO)Marshal.PtrToStructure(Buffer, typeof(CONADefinitions.CONAPI_FOLDER_INFO));
                int index = this.Items.Add("[" + FolderInfo.pstrName + "]");
                // Setting folder name as itemdata
                Array.Resize(ref ItemData, Items.Count + 1);
                ItemData[index] = FolderInfo.pstrName;
                iResult = CONAFileSystem.CONAFreeFolderInfoStructure(Buffer);
                if (iResult != PCCSErrors.CONA_OK)
                {
                    PCCAPIUtils.ShowErrorMessage("PhoneListBox::ShowFolders(): CONAFreeFolderInfoStructure failed", iResult);
                }
                iResult = CONAFileSystem.CONAFindNextFolder(hFindHandle, Buffer);
            }
            if (iResult != PCCSErrors.ECONA_ALL_LISTED & iResult != PCCSErrors.CONA_OK)
            {
                PCCAPIUtils.ShowErrorMessage("PhoneListBox::ShowFolders(): CONAFindNextFolder failed!", iResult);
            }
        }

        //===================================================================
        // ShowFiles
        //
        // Adds all found files to listbox by using CONAFindNextFile.
        // 
        //===================================================================
        public void ShowFiles(int hFindHandle)
        {
            CONADefinitions.CONAPI_FILE_INFO FileInfo;
            int iResult;
            // Allocate memory for buffer
            IntPtr Buffer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CONADefinitions.CONAPI_FILE_INFO)));
            iResult = CONAFileSystem.CONAFindNextFile(hFindHandle, Buffer);
            while (iResult == PCCSErrors.CONA_OK)
            {
                // Copy data from buffer
                FileInfo = (CONADefinitions.CONAPI_FILE_INFO)Marshal.PtrToStructure(Buffer, typeof(CONADefinitions.CONAPI_FILE_INFO));
                int index = this.Items.Add(FileInfo.pstrName);
                // Setting file name as itemdata
                Array.Resize(ref ItemData, Items.Count + 1);

                ItemData[index] = FileInfo.pstrName;
                iResult = CONAFileSystem.CONAFreeFileInfoStructure(Buffer);
                if (iResult != PCCSErrors.CONA_OK)
                {
                    PCCAPIUtils.ShowErrorMessage("PhoneListBox::ShowFiles(): CONAFreeFileInfoStructure failed!", iResult);
                }
                iResult = CONAFileSystem.CONAFindNextFile(hFindHandle, Buffer);
            }
            if (iResult != PCCSErrors.ECONA_ALL_LISTED & iResult != PCCSErrors.CONA_OK)
            {
                PCCAPIUtils.ShowErrorMessage("PhoneListBox::ShowFiles(): CONAFindNextFile failed!", iResult);
            }
        }

        //===================================================================
        // ShowPhoneFolder
        //
        // Adds all files and folders to listbox by using
        // functions CONAFindBegin and CONAFindEnd.
        // 
        //===================================================================
        public void ShowPhoneFolder(string strFolder)
        {
            int hFS = 0;
            int hFind = 0;
            int iMedia = CONADefinitions.API_MEDIA_ALL;
            int iDeviceID = 0;
            int iResult = CONAFileSystem.CONAOpenFS(m_strCurrentSN, ref iMedia, ref hFS, ref iDeviceID);
            if (iResult == PCCSErrors.CONA_OK)
            {
                int iFindOtions = 0;
                if (Common.MainForm.UseCache())
                    iFindOtions = CONADefinitions.CONA_FIND_USE_CACHE;

                iResult = CONAFileSystem.CONAFindBegin(hFS, iFindOtions, ref hFind, strFolder);
                if (iResult == PCCSErrors.CONA_OK)
                {
                    ResetContent();
                    this.Items.Add("[..]");
                    ShowFolders(hFind);
                    ShowFiles(hFind);
                    m_strCurrentFolder = strFolder;
                    iResult = CONAFileSystem.CONAFindEnd(hFind);
                    if (iResult != PCCSErrors.CONA_OK)
                    {
                        PCCAPIUtils.ShowErrorMessage("PhoneListBox::ShowPhoneFolder(): CONAFindEnd failed!", iResult);
                    }
                }
                else
                {
                    PCCAPIUtils.ShowErrorMessage("PhoneListBox::ShowPhoneFolder(): CONAFindBegin() failed!", iResult);
                    ListAllPhones();
                }
                iResult = CONAFileSystem.CONACloseFS(hFS);
                if (iResult != PCCSErrors.CONA_OK)
                {
                    PCCAPIUtils.ShowErrorMessage("PhoneListBox::ShowPhoneFolder(): CONACloseFS failed!", iResult);
                }
            }
            else
            {
                PCCAPIUtils.ShowErrorMessage("PhoneListBox::ShowPhoneFolder(): CONAOpenFS failed!", iResult);
            }
            CONADefinitions.CONAPI_DEVICE Device;
            // Allocate memory for buffer
            IntPtr Buffer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CONADefinitions.CONAPI_DEVICE)));
            iResult = CONADeviceManagement.CONAGetDevice(m_hDMHandle, m_strCurrentSN, Buffer);
            if (iResult == PCCSErrors.CONA_OK)
            {
                // Copy data from buffer
                Device = (CONADefinitions.CONAPI_DEVICE)Marshal.PtrToStructure(Buffer, typeof(CONADefinitions.CONAPI_DEVICE));
                string mFN = Device.pstrFriendlyName;
                Common.MainForm.LBL_PhoneFiles.Text = mFN + ":" + strFolder;
                iResult = CONADeviceManagement.CONAFreeDeviceStructure(1, Buffer);
                if (iResult != PCCSErrors.CONA_OK)
                {
                    PCCAPIUtils.ShowErrorMessage("PhoneListBox::ShowPhoneFolder(): CONAFreeDeviceStructure failed!", iResult);
                }
            }
        }

        //===================================================================
        // GetCurrentSN
        //
        // Returns serial number of currently selected phone
        // 
        //===================================================================
        public string GetCurrentSN()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
婷婷久久综合九色综合伊人色| 亚洲一区二区三区爽爽爽爽爽| 国产精品网友自拍| 一区二区免费在线| 国产精品综合av一区二区国产馆| 色婷婷综合久色| 久久综合色婷婷| 日本视频在线一区| 色综合色综合色综合色综合色综合| 日韩精品一区二区三区在线| 一区二区在线看| 国产精品一区二区你懂的| 欧美日韩成人在线| 日韩理论电影院| 国产大陆亚洲精品国产| 欧美一区二区女人| 亚洲大片一区二区三区| 色综合久久88色综合天天| 国产区在线观看成人精品| 蜜臀91精品一区二区三区| 欧美在线视频全部完| 国产精品久久久久久亚洲毛片| 狠狠久久亚洲欧美| 91精品国产欧美日韩| 亚洲国产视频在线| 色综合亚洲欧洲| 一区在线观看视频| 成人黄色777网| 久久久久久久久久久黄色| 另类小说综合欧美亚洲| 欧美一级高清片| 美国十次了思思久久精品导航| 这里只有精品99re| 亚洲18女电影在线观看| 欧美在线你懂得| 婷婷一区二区三区| 欧美色手机在线观看| 偷拍一区二区三区| 欧美精品视频www在线观看| 亚洲精品国产无天堂网2021| 欧美最新大片在线看| 亚洲国产精品麻豆| 欧美日韩不卡在线| 日本不卡一区二区| 日韩一卡二卡三卡| 国产一区二区三区久久久| 久久伊99综合婷婷久久伊| 国产成人在线观看| 亚洲欧洲国产日本综合| 波多野结衣精品在线| 亚洲猫色日本管| 欧美日韩一区二区欧美激情| 无码av中文一区二区三区桃花岛| 日韩欧美在线1卡| 国产精品一级在线| 亚洲欧美综合另类在线卡通| 欧美自拍丝袜亚洲| 久久精品国产亚洲aⅴ| 久久久夜色精品亚洲| 99精品视频在线播放观看| 亚洲一区视频在线观看视频| 欧美成人一级视频| 99热99精品| 三级成人在线视频| 国产色91在线| 91成人在线精品| 久久99精品国产麻豆不卡| 国产精品成人一区二区艾草 | 91精品国产综合久久久蜜臀图片| 青青草原综合久久大伊人精品| 国产欧美视频一区二区三区| 欧美在线看片a免费观看| 日本va欧美va精品| 国产精品欧美一区二区三区| 在线亚洲精品福利网址导航| 国产一区在线不卡| 亚洲综合自拍偷拍| 精品国产伦一区二区三区免费| 91丨porny丨在线| 毛片基地黄久久久久久天堂| 亚洲免费资源在线播放| 精品久久人人做人人爰| 91久久国产综合久久| 国产一区二区三区精品视频| 亚洲制服丝袜av| 欧美国产一区视频在线观看| 91精品国产91综合久久蜜臀| 99久久精品免费看国产 | 成人免费黄色大片| 天堂va蜜桃一区二区三区| 欧美韩国日本综合| 精品三级在线看| 欧美日本国产一区| 99国产精品久久久久久久久久久| 激情图片小说一区| 丝袜国产日韩另类美女| 国产精品高潮久久久久无| xf在线a精品一区二区视频网站| 欧美精品一卡两卡| 欧美性受xxxx黑人xyx性爽| 国产东北露脸精品视频| 精品一区二区在线观看| 日韩福利电影在线| 亚洲一区二区在线免费观看视频| 国产精品成人免费| 中文字幕高清不卡| 欧美国产日产图区| 久久只精品国产| 久久亚洲私人国产精品va媚药| 日韩欧美不卡一区| 欧美一区二区美女| 日韩欧美一卡二卡| 欧美一区二区在线看| 欧美日韩久久一区| 欧美日韩国产综合视频在线观看 | 日韩精品中文字幕在线一区| 欧美一区二区三区四区久久| 6080午夜不卡| 欧美精品一区二| 久久精品一区二区三区不卡| 久久精品人人爽人人爽| 国产欧美精品国产国产专区 | 五月天网站亚洲| 日韩精品乱码免费| 日本欧美大码aⅴ在线播放| 亚洲大片精品永久免费| 日韩精品91亚洲二区在线观看| 日韩av电影一区| 久久精工是国产品牌吗| 国产尤物一区二区| 国产成人免费视频一区| 99综合电影在线视频| 一本久久a久久免费精品不卡| 欧洲av一区二区嗯嗯嗯啊| 7878成人国产在线观看| 欧美变态凌虐bdsm| 国产欧美一区二区在线观看| 亚洲欧洲日产国产综合网| 亚洲主播在线播放| 日韩成人dvd| 国产成人自拍网| 日本道精品一区二区三区| 在线成人av网站| 国产欧美精品在线观看| 悠悠色在线精品| 久久精品国产久精国产爱| av亚洲精华国产精华| 欧美日韩aaa| 国产亚洲精品aa| 亚洲一二三四区不卡| 国产一区二区三区在线看麻豆| 99在线精品视频| 日韩欧美国产综合在线一区二区三区| 欧美—级在线免费片| 日韩国产一区二| 成人午夜短视频| 欧美日韩国产乱码电影| 久久久久久久综合色一本| 亚洲电影一级片| 成人精品视频一区二区三区| 91精品中文字幕一区二区三区| 欧美国产成人在线| 日韩av一二三| av激情亚洲男人天堂| 亚洲精品在线网站| 一区二区三区日韩精品视频| 国产精品一区二区在线观看网站| 欧美日韩免费观看一区二区三区 | 99国产精品久| 久久综合九色综合欧美就去吻| 亚洲最大的成人av| 韩国一区二区三区| 日本高清成人免费播放| 制服丝袜成人动漫| 一区二区三区高清| 国产一区二区三区免费| 欧美三区免费完整视频在线观看| 国产精品国产三级国产普通话三级| 日韩精品1区2区3区| 99re8在线精品视频免费播放| 久久综合色一综合色88| 视频精品一区二区| 99国产精品国产精品毛片| 99久久综合狠狠综合久久| 欧美精品一区二区三区四区 | 中文字幕av在线一区二区三区| 日本不卡一区二区| 日本韩国欧美在线| 国产欧美日韩久久| 国产一区福利在线| 91精品国产高清一区二区三区| 亚洲美女一区二区三区| av在线一区二区三区| 久久蜜桃av一区精品变态类天堂 | 欧美日韩中文字幕一区二区| 久久久久久夜精品精品免费| 青青草原综合久久大伊人精品 | 欧美色综合影院| 亚洲欧美成aⅴ人在线观看| 狠狠色2019综合网|