如何使用 WiFi Direct 打印文本文件

2024-05-07

我有一个正在运行的 Android 应用程序,可以显示用户统计信息。我想将纯文本格式 (.txt) 的小报告发送到 WiFi Direct 打印机。我已经下载了示例demo https://developer.android.com/guide/topics/connectivity/wifip2p.html来自 Android 的应用程序。我进行了适当的修改以查找 .txt 文件。但我不明白为什么我的代码不起作用。选择我要打印的文件后,没有任何反应。

我的 EPSON 打印机的当前配置如下。

  • Wi-Fi Direct 模式:开

  • 通讯方式:AP

  • 工作模式:IEEE802.11g/n

  • 通讯速度:自动

  • SSID:直接-D3A36C54
  • 频道:7
  • 安全级别:WPA2-PSK(AES)

  • 链接状态:未知

这是 DeviceDetailFragment 类

public class DeviceDetailFragment extends Fragment implements WifiP2pManager.ConnectionInfoListener {
    protected static final int CHOOSE_FILE_RESULT_CODE = 20;
    private View mContentView = null;
    private WifiP2pDevice device;
    private WifiP2pInfo info;
    ProgressDialog progressDialog = null;
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mContentView = inflater.inflate(R.layout.device_detail, null);
        mContentView.findViewById(R.id.btn_connect).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                WifiP2pConfig config = new WifiP2pConfig();
                config.deviceAddress = device.deviceAddress;
                config.wps.setup = WpsInfo.LABEL;
                config.wps.pin = "12345677";
//                config.groupOwnerIntent = 15;
                if (progressDialog != null && progressDialog.isShowing()) {
                    progressDialog.dismiss();
                }
                progressDialog = ProgressDialog.show(getActivity(), "Press back to cancel",
                        "Connecting to :" + device.deviceAddress, true, true
//                        new DialogInterface.OnCancelListener() {
//
//                            @Override
//                            public void onCancel(DialogInterface dialog) {
//                                ((DeviceActionListener) getActivity()).cancelDisconnect();
//                            }
//                        }
                );
                ((DeviceListFragment.DeviceActionListener) getActivity()).connect(config);
            }
        });
        mContentView.findViewById(R.id.btn_disconnect).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        ((DeviceListFragment.DeviceActionListener) getActivity()).disconnect();
                    }
                });
        mContentView.findViewById(R.id.btn_start_client).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        // Allow user to pick a text file from storage or other
                        // registered apps
                        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
                        intent.setType("text/*");
//                        intent.setType("image/*");
                        startActivityForResult(intent, CHOOSE_FILE_RESULT_CODE);
                    }
                });
        return mContentView;
    }
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        // User has picked a text file. Transfer it to group owner i.e peer using
        // FileTransferService.
        Uri uri = data.getData();
        TextView statusText = (TextView) mContentView.findViewById(R.id.status_text);
        statusText.setText("Sending: " + uri);
        Log.d(WiFiDirectActivity.TAG, "Intent----------- " + uri);
        Intent serviceIntent = new Intent(getActivity(), FileTransferService.class);
        serviceIntent.setAction(FileTransferService.ACTION_SEND_FILE);
        serviceIntent.putExtra(FileTransferService.EXTRAS_FILE_PATH, uri.toString());
        serviceIntent.putExtra(FileTransferService.EXTRAS_GROUP_OWNER_ADDRESS,
                info.groupOwnerAddress.getHostAddress());
        serviceIntent.putExtra(FileTransferService.EXTRAS_GROUP_OWNER_PORT, 8315); //631
        getActivity().startService(serviceIntent);
    }
    @Override
    public void onConnectionInfoAvailable(final WifiP2pInfo info) {
        if (progressDialog != null && progressDialog.isShowing()) {
            progressDialog.dismiss();
        }
        this.info = info;
        this.getView().setVisibility(View.VISIBLE);
        // The owner IP is now known.
        TextView view = (TextView) mContentView.findViewById(R.id.group_owner);
        view.setText(getResources().getString(R.string.group_owner_text)
                + ((info.isGroupOwner == true) ? getResources().getString(R.string.yes)
                : getResources().getString(R.string.no)));
        // InetAddress from WifiP2pInfo struct.
        view = (TextView) mContentView.findViewById(R.id.device_info);
        view.setText("Group Owner IP - " + info.groupOwnerAddress.getHostAddress());
        // After the group negotiation, we assign the group owner as the file
        // server. The file server is single threaded, single connection server
        // socket.
        if (info.groupFormed && info.isGroupOwner) {
            new FileServerAsyncTask(getActivity(), mContentView.findViewById(R.id.status_text))
                    .execute();
        } else if (info.groupFormed) {
            // The other device acts as the client. In this case, we enable the
            // get file button.
            mContentView.findViewById(R.id.btn_start_client).setVisibility(View.VISIBLE);
            ((TextView) mContentView.findViewById(R.id.status_text)).setText(getResources()
                    .getString(R.string.client_text));
        }
        // hide the connect button
        mContentView.findViewById(R.id.btn_connect).setVisibility(View.GONE);
    }
    /**
     * Updates the UI with device data
     *
     * @param device the device to be displayed
     */
    public void showDetails(WifiP2pDevice device) {
        this.device = device;
        this.getView().setVisibility(View.VISIBLE);
        TextView view = (TextView) mContentView.findViewById(R.id.device_address);
        view.setText(device.deviceAddress);
        view = (TextView) mContentView.findViewById(R.id.device_info);
        view.setText(device.toString());
    }
    /**
     * Clears the UI fields after a disconnect or direct mode disable operation.
     */
    public void resetViews() {
        mContentView.findViewById(R.id.btn_connect).setVisibility(View.VISIBLE);
        TextView view = (TextView) mContentView.findViewById(R.id.device_address);
        view.setText(R.string.empty);
        view = (TextView) mContentView.findViewById(R.id.device_info);
        view.setText(R.string.empty);
        view = (TextView) mContentView.findViewById(R.id.group_owner);
        view.setText(R.string.empty);
        view = (TextView) mContentView.findViewById(R.id.status_text);
        view.setText(R.string.empty);
        mContentView.findViewById(R.id.btn_start_client).setVisibility(View.GONE);
        this.getView().setVisibility(View.GONE);
    }
    /**
     * A simple server socket that accepts connection and writes some data on
     * the stream.
     */
    public static class FileServerAsyncTask extends AsyncTask<Void, Void, String> {
        private Context context;
        private TextView statusText;
        /**
         * @param context
         * @param statusText
         */
        public FileServerAsyncTask(Context context, View statusText) {
            this.context = context;
            this.statusText = (TextView) statusText;
        }
        @Override
        protected String doInBackground(Void... params) {
            try {
                ServerSocket serverSocket = new ServerSocket(8315); //631
                Log.d(WiFiDirectActivity.TAG, "Server: Socket opened");
                Socket client = serverSocket.accept();

                Log.d(WiFiDirectActivity.TAG, "Server: connection done");
//                final File f = new File(Environment.getExternalStorageDirectory() + "/"
//                        + context.getPackageName() + "/wifip2pshared-" + System.currentTimeMillis()
//                        + ".txt");


                final File f = new File(Environment.getExternalStorageDirectory() + "/"
                        + context.getPackageName() + "/wifip2pshared-" + ".txt");
                File dirs = new File(f.getParent());
                if (!dirs.exists())
                    dirs.mkdirs();
                f.createNewFile();
                Log.d(WiFiDirectActivity.TAG, "server: copying files " + f.toString());
                InputStream inputstream = client.getInputStream();
                copyFile(inputstream, new FileOutputStream(f));
                serverSocket.close();
                return f.getAbsolutePath();
            } catch (IOException e) {
                Log.e(WiFiDirectActivity.TAG, e.getMessage());
                return null;
            }
        }
        /*
         * (non-Javadoc)
         * @see android.os.AsyncTask#onPostExecute(java.lang.Object)
         */
        @Override
        protected void onPostExecute(String result) {
            if (result != null) {
                statusText.setText("File copied - " + result);
//                Log.e("...File copied - ", result);
                Intent intent = new Intent();
                intent.setAction(android.content.Intent.ACTION_VIEW);
                intent.setDataAndType(Uri.parse("file://" + result), "text/*");
                context.startActivity(intent);
            } else {
                Log.e("File copied is NULL- ", result);
            }
        }
        /*
         * (non-Javadoc)
         * @see android.os.AsyncTask#onPreExecute()
         */
        @Override
        protected void onPreExecute() {
            statusText.setText("Opening a server socket");
        }
    }
    public static boolean copyFile(InputStream inputStream, OutputStream out) {
        byte buf[] = new byte[1024];
        int len;
        try {
            while ((len = inputStream.read(buf)) != -1) {
                out.write(buf, 0, len);
            }
            out.close();
            inputStream.close();
        } catch (IOException e) {
            Log.d(WiFiDirectActivity.TAG, e.toString());
            return false;
        }
        return true;
    }
}

EDIT #1这是我的权限设置

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.BIND_PRINT_SERVICE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

连接到打印机后,我有选择文件的 UI,选择后没有任何反应,我只得到下面的控制台输出(我拾取的文件位于 SD 卡中)

  • 05-17 10:39:50.994 28659-28659/com.example.ccano.wifidirect E/ViewRootImpl: sendUserActionEvent() mView == null

  • 05-17 10:39:52.314 28659-28659/com.example.ccano.wifidirect D/ViewRootImpl: ViewPostImeInputStage processPointer 0

  • 05-17 10:39:52.384 28659-28659/com.example.ccano.wifidirect D/ViewRootImpl:ViewPostImeInputStage processPointer 1

  • 05-17 10:39:56.484 28659-28659/com.example.ccano.wifidirect D/wifidirectdemo:意图---------
    内容://com.android.externalstorage.documents/document/9C33-6BBD%3Asample_file.txt

  • 05-17 10:39:56.514 28659-28659/com.example.ccano.wifidirect D/wifidirectdemo:P2P 状态已更改 - 2

  • 05-17 10:39:56.514 28659-29309/com.example.ccano.wifidirect D/wifidirectdemo:打开客户端套接字 -

  • 05-17 10:39:56.514 28659-28659/com.example.ccano.wifidirect D/wifidirectdemo:对等状态:0

  • 05-17 10:39:56.524 28659-29309/com.example.ccano.wifidirect D/wifidirectdemo:客户端套接字 - true
  • 05-17 10:39:56.524 28659-29309/com.example.ccano.wifidirect E/ccano..copyfile: true

  • 05-17 10:39:56.524 28659-29309/com.example.ccano.wifidirect D/wifidirectdemo:客户端:写入数据

  • 05-17 10:39:56.534 28659-28659/com.example.ccano.wifidirect I/时间线:时间线:Activity_idle id:
    android.os.BinderProxy@75dd5e 时间:4602644
  • 05-17 10:41:01.714 28659-28659/com.example.ccano.wifidirect D/ViewRootImpl: ViewPostImeInputStage processPointer 0
  • 05-17 10:41:01.774 28659-28659/com.example.ccano.wifidirect D/ViewRootImpl:ViewPostImeInputStage processPointer 1
  • 05-17 10:41:02.564 28659-28659/com.example.ccano.wifidirect D/wifidirectdemo:P2P 对等点已更改
  • 05-17 10:41:02.574 28659-28659/com.example.ccano.wifidirect D/wifidirectdemo:对等状态:3
  • 05-17 10:41:02.594 28659-28659/com.example.ccano.wifidirect D/wifidirectdemo:未找到设备

EDIT #2

将以下行添加到我的清单中后,我仍然得到相同的结果,没有任何反应。

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Edit #3

现在将 WpsInfo.Label 更改为 WpsInfo.PBC 后,我在调试器控制台上得到了不同的输出。 (参见下面的屏幕截图)。但是,打印机仍然没有发送打印作业。


事实证明我的代码没问题,经过几天的测试和研究,我发现问题出在socket类上,我使用的是Google在演示代码中提供的默认类(这就是我正在使用的socket类) )但是,在阅读了官方文档后Wi-Fi.org http://www.wi-fi.org/discover-wi-fi/wi-fi-direct我可以理解端口号很重要,为了使其能够与 WiFi Direct 配合使用,您只需将目标端口 #631 设为目标,打印机就会询问您 PIN 密码(如果启用)。现在,如果您想使用 P2P 并绕过密码,则必须使用端口 #9100。

因此,我使用端口 9100 和 631 来完成此操作,现在我正在打印 txt 文件。

现在,如果你想打印PDF,你只需要添加:

intent.setType("application/pdf"); 

intent.setDataAndType(Uri.parse("file://" + result), "application/pdf");

到 DeviceDetailFragment 类(上面发布了该类)。

我希望这篇文章能够提供有关 Android 打印与 P2P 通信的良好理解和深入了解。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 WiFi Direct 打印文本文件 的相关文章

  • CookieManager.getInstance().removeAllCookie();不删除所有cookie

    我在应用程序的 onCreate 中调用 CookieManager getInstance removeAllCookie 我遇到了一个奇怪的问题 我看到 GET 请求中传递了意外的 cookie 值 事实上 cookie 值是一个非常非
  • Java中接口作为方法参数

    前几天去面试 被问到了这样的问题 问 反转链表 给出以下代码 public class ReverseList interface NodeList int getItem NodeList nextNode void reverse No
  • Android相机意图:如何获取全尺寸照片?

    我正在使用意图来启动相机 Intent cameraIntent new Intent android provider MediaStore ACTION IMAGE CAPTURE getParent startActivityForR
  • Android Studio:无法启动守护进程

    当我尝试在 Android Studio 中导入 gradle 项目时 遇到以下错误 Unable to start the daemon process This problem might be caused by incorrect
  • 制作java包

    我的 Java 类组织变得有点混乱 所以我要回顾一下我在 Java 学习中跳过的东西 类路径 我无法安静地将心爱的类编译到我为它们创建的包中 这是我的文件夹层次结构 com david Greet java greeter SayHello
  • 如何在不更改手机语言的情况下更改Android应用程序语言?

    我希望用户在应用程序内选择一种语言 选择语言后 我希望字符串使用特定语言 如果我更改手机语言 那么我的应用程序将以设置的语言运行 我无法找到任何在不更改手机语言的情况下设置语言的方法 此外 一旦设置了语言 更改就应该反映出来 有人可以建议一
  • 调节麦克风录音音量

    我们正在尝试调整录音时的音量级别 麦克风似乎非常敏感 会接收到很多静电 我们查看了 setVolumeControlStream 但找不到传入其中来控制麦克风的流 将您的音频源设置为 MIC using MediaRecorder Audi
  • 尝试使用 Ruby Java Bridge (RJB) gem 时出现错误“无法创建 Java VM”

    我正在尝试实现 Ruby Java Bridge RJB gem 来与 JVM 通信 以便我可以运行 Open NLP gem 我在 Windows 8 上安装并运行了 Java 所有迹象 至少我所知道的 都表明 Java 已安装并可运行
  • 使用 AWS Java SDK 为现有 S3 对象设置 Expires 标头

    我正在更新 Amazon S3 存储桶中的现有对象以设置一些元数据 我想设置 HTTPExpires每个对象的标头以更好地处理 HTTP 1 0 客户端 我们正在使用AWS Java SDK http aws amazon com sdkf
  • org.jdesktop.application 包不存在

    几天以来我一直在构建一个 Java 桌面应用程序 一切都很顺利 但是今天 当我打开Netbeans并编译文件时 出现以下编译错误 Compiling 9 source files to C Documents and Settings Ad
  • Android 设备上的静默安装

    我已经接受了一段时间了 在 Android 上静默安装应用程序是不可能的 也就是说 让程序安装捆绑为 APK 的应用程序 而不提供标准操作系统安装提示并完成应用程序安装程序活动 但现在我已经拿到了 Appbrain 快速网络安装程序的副本
  • 应用程序关闭时的倒计时问题

    我制作了一个 CountDownTimer 代码 我希望 CountDownTimer 在完成时重新启动 即使应用程序已关闭 但它仅在应用程序正在运行或重新启动应用程序时重新启动 因此 如果我在倒计时为 00 10 分钟 秒 时关闭应用程序
  • 将 JSON 参数从 java 发布到 sinatra 服务

    我有一个 Android 应用程序发布到我的 sinatra 服务 早些时候 我无法读取 sinatra 服务上的参数 但是 在我将内容类型设置为 x www form urlencoded 之后 我能够看到参数 但不完全是我想要的 我在
  • Android中webview的截图方法

    我在 webview 中的 html5 canvas 上画了一些线 并尝试使用下面的代码截取 webview 的屏幕截图 WebView webView WebView findViewById R id webview webView s
  • Springs 元素“beans”不能具有字符 [children],因为该类型的内容类型是仅元素

    我在 stackoverflow 中搜索了一些页面来解决这个问题 确实遵循了一些正确的答案 但不起作用 我是春天的新人 对不起 这是我的调度程序 servlet
  • 将 JTextArea 内容写入文件

    我在 Java Swing 中有一个 JTextArea 和一个 提交 按钮 需要将textarea的内容写入一个带有换行符的文件中 我得到的输出是这样的 它被写为文件中的一个字符串 try BufferedWriter fileOut n
  • android Accessibility-service 突然停止触发事件

    我有一个 AccessibilityService 工作正常 但由于开发过程中的某些原因它停止工作 我似乎找不到这个原因 请看一下我的代码并告诉我为什么它不起作用 public class MyServicee extends Access
  • 中断连接套接字

    我有一个 GUI 其中包含要连接的服务器列表 如果用户单击服务器 则会连接到该服务器 如果用户单击第二个服务器 它将断开第一个服务器的连接并连接到第二个服务器 每个新连接都在一个新线程中运行 以便程序可以执行其他任务 但是 如果用户在第一个
  • 找到 Android 浏览器中使用的 webkit 版本?

    有没有办法知道某些特定手机上的 Android 浏览器使用的是哪个版本的 webkit 软件 如果有一个您可以浏览以获取该信息的 URL 那就太好了 但任何其他方式也很好 如果你知道 webkit 版本 你就知道 html5 支持多少 至少
  • java8 Collectors.toMap() 限制?

    我正在尝试使用java8Collectors toMap on a Stream of ZipEntry 这可能不是最好的想法 因为在处理过程中可能会发生异常 但我想这应该是可能的 我现在收到一个我不明白的编译错误 我猜是类型推理引擎 这是

随机推荐

  • 如何将 OLE 自动化日期值转换为 SQL Server 中的日期

    我的应用程序存储日期作为 OLE 自动化与DateTime ToOADate 命令 我需要创建一个 SQL 视图来显示存储的日期 如何快速将双精度数转换为日期 Does SELECT CAST CASE WHEN OLEFLOAT gt 0
  • 为什么 MySQL 不允许我删除“更新 CURRENT_TIMESTAMP 时”属性?

    我有一个包含两个时间戳字段的表 我只是用名称和类型定义了它们TIMESTAMP 但由于某种原因 MySQL 自动设置其中一个默认值和属性on update CURRENT TIMESTAMP 我计划在这两个字段中都没有默认值 但其中一个字段
  • 如何在不更改源代码的情况下禁用 TLSv1?

    我编写了一个测试代码 不是 HTTPS 来使用 JDK8 测试 TLS 当测试代码运行时 我使用nmap工具扫描并得到结果如下 D softwares nmap 7 12 gt nmap p xxxx script ssl x x x x
  • 是否值得将 Doctrine 2 与 Zend Framework 一起使用?

    我知道有些用户在 Zend Framework 中使用 Doctrine 2 而不是 Zend Db 但我不知道为什么 为什么 Doctrine2 比 Zend Db 好 为什么 Zend Db 不好 Thanks 2013 年 3 月 7
  • Java中对象的序列化需要什么? [关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 谁能告诉我Java中对象序列化的需求是什么 并给我一个示例场景来解释需求 我已经了解什么是序列化 我只是想了解何时使用它以及如何使用它
  • 如何判断一个日期是否在其他两个日期之间?

    我有以下代码 if date in start end print in between else print No date start end都是变量 格式为1 1 我应该怎么做才能打印出正确的结果 我尝试将日期设置为 10 2 开始为
  • android中如何实现列表之间的拖放?

    我试图做到这一点 以便用户可以从一个列表视图中拖动文本视图 然后将其放入另一个列表视图中 但我发现这非常困难 到目前为止我发现的最大问题是 onTouchEvents 似乎只能在 ACTION DOWN 事件起源的视图中听到 我将单击一个列
  • 将项目添加到 JComboBox

    我在面板上使用组合框 据我所知 我们可以仅添加带有文本的项目 comboBox addItem item text 但有时我需要使用项目和项目文本的某些值 例如在 html select 中
  • Fortran 中的数组第一个索引

    我认为 Fortran 中数组的第一个索引是 1 但是为什么这段代码可以工作呢 代码是 Wavewatch 的修改部分 http polar ncep noaa gov waves wavewatch http polar ncep noa
  • 使用 Hibernate 映射数组

    你能帮我使用 Hibernate 映射这个类吗 public class MyClass private Long id private String name private int values 我使用的是 PostgreSQL 表中的
  • c/c++ strptime() 不解析 %Z 时区名称

    我是 C 语言的新手 当我练习 C 语言时 我会花时间来回构建 tm 我注意到一些不同 请告诉我我做错了什么 include
  • iOS:同时使用 Facebook 和 Google、Google Plus 登录

    早上好 我正在尝试在同一视图中实现 Facebook 登录 工作正常 以及 google plus 登录 我正在遵循官方网站 Google 的指南 但 Facebook 按钮和 google plus 按钮之间存在问题 Facebook 告
  • 开始使用 Python 进行安全 AWS CloudFront 流式传输

    我已经创建了一个 S3 存储桶 上传了一个视频 并在 CloudFront 中创建了一个流分配 用静态 HTML 播放器对其进行了测试 它可以工作 我已经通过帐户设置创建了密钥对 目前我的桌面上有私钥文件 这就是我所在的地方 我的目标是让我
  • 从远程存储库下载父pom

    是否可以 以及如何 从远程存储库下载父 pom 为什么 我有一个包含许多模块的项目设置 父 pom 指定对第三方 jar 的依赖关系 如果其中一个模块需要其中一个罐子的更高版本中的新功能 我想 参考新的 jar 更新父 pom 更新引用新父
  • 通过浏览器的“BACK”功能加载页面时触发 onload 脚本(js 或 jQuery)

    当通过浏览器的 后退 按钮或键盘命令到达页面时 我找不到执行脚本的方法 背景 我需要知道是否使用浏览器的 后退 按钮或键盘命令打开页面 然后我可以检查存储的 sessionStorage 变量并触发一些适当的内容 例如 如果我将其放入我的页
  • python:如何改变音量?

    I used winsound Beep frequency duration 因为我想以指定的频率播放声音 现在 我需要更改这些声音的音量 我怎样才能做到这一点 我试图寻求帮助pyaudio but 如果您对外部库开放 您可以使用pydu
  • Perl OO 方法调用第一个参数值 (->)

    就 Perl OO 而言 到底做了什么 gt do 例如我拨打 main 电话 result a b gt mymethod 在我定义的包中mymethod 我使用以下内容 my class 总的来说 我显然没有向mymethod 那么哪里
  • 来自 Step Function 的跨账户 Lambda 调用

    我在帐户 A 中有 Step Function 并且在帐户 B 中有 lambda 但是在运行 step 函数时 它给出 An error occurred while executing the state lambdaB entered
  • 在将所有导航属性加载(惰性或急切)到内存之前对其进行过滤

    对于未来的访问者 对于 EF6 您最好使用过滤器 例如通过此项目 https github com jbogard EntityFramework Filters https github com jbogard EntityFramewo
  • 如何使用 WiFi Direct 打印文本文件

    我有一个正在运行的 Android 应用程序 可以显示用户统计信息 我想将纯文本格式 txt 的小报告发送到 WiFi Direct 打印机 我已经下载了示例demo https developer android com guide to