【问题标题】:Can not find PInvoke DLL kernel32.dll file C#找不到 PInvoke DLL kernel32.dll 文件 C#
【发布时间】:2014-04-26 05:29:13
【问题描述】:

我正在尝试通过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. 单击“确定”按钮将所选组件添加到您的项目中。

这是我的代码:

     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#"

知道我能做什么吗?

【问题讨论】:

    标签: c# rapi


    【解决方案1】:

    您应该改用RAPI2RAPI2 替换 RAPI。

    【讨论】:

    • 别担心...我会试试@Brett Nemec
    猜你喜欢
    • 2018-07-22
    • 2012-07-25
    • 1970-01-01
    • 2012-03-13
    • 1970-01-01
    • 2012-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多