0

USBデータを送信するために、電話デバイスをサーバーに接続しようとしています。

これは私RAPIのコードです。

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlServerCe;
using OpenNETCF.Desktop.Communication;

OpenNETCF.Desktop.Communication次の手順に従って追加しました。

  1. ソリューション エクスプローラー ウィンドウで、[参照設定] フォルダーを右クリックします。ポップアップ メニューが表示されます。
  2. メニューから [参照の追加] を選択します。
  3. [参照の追加] ダイアログ ボックスが表示されます。OpenNETCF.Desktop.Communication コンポーネントを選択します。
  4. [OK] ボタンをクリックして、選択したコンポーネントをプロジェクトに追加します。

そして、これは私のコードです:

     private void BTN_LEVANTAMIENTO_Click(object sender, EventArgs e)
     {
            try
            {
                RAPI myrapi = new RAPI(); //Is it Okay?
                myrapi.Connect();
                while (!myrapi.DevicePresent)
                {
                    MessageBox.Show("Please connect your device to your PC using ActiveSync and before clicking the OK button.",
                      "No Device Present");
                    //myrapi.Connect();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("The following error occurred while attempting to connect to" + " your device - " + ex.Message,
                  "Connection Error");
                Application.Exit();
            } 

それが私に示す問題は

"No se puede encontrar el archivo DLL PInvoke kernel32.dll c#"

私に何ができるかについて何か考えはありますか?

4

1 に答える 1

2

代わりにRAPI2を使用する必要があります。RAPI2は RAPI を置き換えます。

于 2014-03-19T18:29:36.347 に答える