iT邦幫忙

DAY 32
2

Windows Mobile系列 第 32

[Windows Mobile]OpenNETCF.Desktop.Communication Library前置作業

OpenNETCF Desktop Communication Library,可由 OpenNETCF 網站取得。此 Library 將Microsoft's Remote API (RAPI) 包進去,因為我們可以透過它使用 RAPI 提供的功能,例如本機電腦與行動裝置檔案傳輸、設定登錄檔、取得行動裝置資訊等。
更多文章,請到我在點部落所建立的部落格「.NET菜鳥自救會」閱讀
http://www.dotblogs.com.tw/chou/

  1. 簡介
    OpenNETCF Desktop Communication Library,可由 OpenNETCF 網站取得。此 Library 將Microsoft's Remote API (RAPI) 包進去,因為我們可以透過它使用 RAPI 提供的功能,例如本機電腦與行動裝置檔案傳輸、設定登錄檔、取得行動裝置資訊等。

  2. 使用前的準備作業
    2.1 下載
    首先到OpenNETCF Desktop Communication Library網站下載,請參考下圖網址與下載位置。
    http://rapi.codeplex.com/

2.2 使用 OpenNETCF Desktop Communication Library
新增專案後,選擇加入現有專案,把 OpenNETCF Desktop Communication Library 加入

將OpenNETCF Desktop Communication Library重新編譯,取得編譯後的 OpenNETCF.Desktop.Communication.dll,將此檔案加入參考

最後,在程式碼中 using,就可以開始使用它了

using OpenNETCF.Desktop.Communication;
  1. OpenNETCF Desktop Communication Library 方法
    Connect 建立與裝置的同步連接。
    CopyFileFromDevice 將裝置中的檔案複製到 PC。
    CopyFileOnDevice 將裝置某個位置的檔案複製到裝置的另一新位置。
    CopyFileToDevice 將 PC 中的檔案複製到裝置。
    CreateDeviceDirectory 在裝置中創建目錄。
    CreateProcess 啟動裝置中的應用程式。
    DeleteDeviceFile 刪除裝置中的檔案。
    DeviceFileExists 檢查裝置中是否存在檔案。
    Disconnect 中斷與裝置的連接。
    EnumFiles 提供與 FileName 參數提供的條件相匹配的 FileInformation 清單。
    GetDeviceCapabilities 檢索裝置的特定裝置訊息。
    GetDeviceFileAttributes 檢索特定裝置檔案的屬性。
    GetDeviceFileSize 檢索裝置檔案的大小,以位元組為單位。
    GetDeviceFileTime 檢索裝置檔案的日期時間。
    GetDeviceMemoryStatus 檢索裝置的記憶體狀態。
    GetDeviceSystemFolderPath 檢索到裝置系統檔案夾的路徑。
    GetDeviceSystemInfo 檢索裝置的系統詳細訊息。
    GetDeviceSystemPowerStatus 檢索裝置的電源狀態。
    GetDeviceVersion 檢索裝置的作業系統版本。
    MoveDeviceFile 將現有裝置檔案移到或重命名到一個新位置。
    RemoveDeviceDirectory 刪除裝置中的目錄。
    SetDeviceFileAttributes 設定裝置中檔案的屬性。
    SetDeviceFileTime 設定裝置中檔案的日期時間。

上一篇
[Windows Mobile]下載與安裝模擬器
下一篇
[Windows Mobiile]OpenNETCF.Desktop.Communication Library使用範例
系列文
Windows Mobile41
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言