RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-243340

bearpro's questions

Martin Hope
bearpro
Asked: 2022-04-17 17:04:13 +0000 UTC

如何强制 GrpcChannel 在 MonoAndroid 上使用 HTTP/2?

  • 0

我正在尝试通过MagicOnion向我的服务器发出请求(它使用来自 gRPC 的传输,但使用不同的序列化协议,消息包而不是protobuf)。

一个小型测试客户端运行net5.0如下:

AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
var address = $"http://{ServerUrl.Host}:5002";
using var channel = GrpcChannel.ForAddress(address);
var myServiceClient = MagicOnionClient.Create<IMyService>(channel);
var result = await myServiceClient.GetMyData();

...并成功收到响应。但是,当我尝试在 Android 上执行完全相同的代码时,我在服务器日志中看到了这个错误:

Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2ConnectionErrorException: HTTP/2 connection error (PROTOCOL_ERROR): Invalid HTTP/2 connection preface.
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ParsePreface(ReadOnlySequence`1& buffer, SequencePosition& consumed, SequencePosition& examined)
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.TryReadPrefaceAsync()
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessRequestsAsync[TContext](IHttpApplication`1 application)

根据日志和流量转储,很明显 .Net 5 上的客户端使用 .Net 5HTTP/2和 Android - HTTP/1.1. 据我了解,这是两个请求之间的唯一区别。

如何使 Android 上的客户端(API 30,monoandroid10)仍然使用HTTP/2?

c#
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2022-04-15 19:55:43 +0000 UTC

如何在 ASP.NET 中注册多个接口的实现?

  • 0

我创建了一个实现多个接口的服务,并试图在 ASP.Net Core 中使用 DI 注册它。就我而言,我希望服务是Singleton,并且在请求任何已实现的接口时,消费者会收到相同的实例。
简而言之,我想要类似的东西

class Impl: IService1, IService2 { }
...
services.AddSingleton<IService1, IService2, Impl>();
...
public SomeController(IService1 service1, IService2 service2)
{
    service1 == service2 // true, потому что это один и тот-же экземпляр
}

我怎样才能做到这一点?

c#
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2022-06-01 16:33:15 +0000 UTC

在 LibreOffice Writer 中按章节对图像和其他对象进行编号(第 1 章中的“图 1.1”,第 2 章中的“图 2.1”)

  • 0

我正在做我的文凭。如问题标题所示,要求对数字进行编号。例子:

第1章

Blah blah blah in Figure 1.1
【图】
图 1.1:Blah blah blah

Blah blah blah in Figure 1.2
【图】
图 1.2:Blah blah blah

第2章

Blah blah blah in Figure 2.1
【图】
图 2.1:Blah blah blah

现在我有了贯穿整个文档的图纸编号,即签名只是“图1”、“图2”等。
在文字中,图片的链接也希望是自动的,而不是手写的。
如何实现示例中的格式化?

PS我知道这个问题并不完全是关于这个网站的主题。如果有人能指出我正确的方向,我将不胜感激。

libre-office
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-09-01 14:07:57 +0000 UTC

尝试在 gdb 中开始调试失败,代码为 1

  • 2

我正在尝试使用书中的教程来学习 gdb。
用 C写了最简单的helloworld,编译 GCC 没有额外的参数。

我跑,gdb -q ./a.out然后当我跑的时候

(gdb) b main 
Breakpoint 1 at 0x113d
(gdb) run
Starting program: /run/media/source/a.out 
exec: The term 'exec' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
During startup program exited with code 1.

这显然是一个错误,与 gdb 中的某些东西是在powershell而不是 bash 中启动的事实有关(我有一个默认的 shell - powershell,但它发生在 linux 上)。但是,从 bash 运行时,此错误完全相同。如何解决?

linux
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-06-30 17:26:00 +0000 UTC

如何更改 Windows 10 功能更新 2004 中的 TTL?

  • 0

全新安装新版本的 Windows 10(我已构建 19041.329)后,DefaultTTL 注册表项停止工作。
被团队发现ping 127.0.0.1。
同时Wireshark显示ICMP Request有DafaultTTL指定的ttl,ICMP Replay有标准ttl-128
。当然,我重启了。

windows
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-06-27 17:36:37 +0000 UTC

使用密钥通过 ssh 连接时失败的原因是什么?

  • 0

我正在尝试使用 ssh 自动将 Web 应用程序交付到服务器。

在服务器上,我创建了一个单独的 Linux 用户并代表它运行 ssh-keygen 命令。
然后我将私钥复制到我的计算机并运行命令

ssh -i id_rsa -oBatchMode=yes -v github-deployer@<ip сервера>

我得到一个错误Permission denied (publickey,password)
同时,服务器配置没有问题,我可以代表另一个用户轻松连接,尽管我以不同的方式生成了密钥(我在我的计算机上生成并上传了服务器的公钥)。

在文件/var/log/auth.log中,当我尝试连接时,我只看到一行:

Jun 27 12:28:07 seterator sshd[20567]: Connection reset by 46.242.39.189 port 64510 [preauth]

使用 -v 开关运行 ssh 客户端时,输出如下:

debug1: Reading configuration data C:\\Users\\m.prokazin/.ssh/config
debug1: Connecting to <ip сервера> [<ip сервера>] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\m.prokazin\\Documents\\tmp\\key type 0  # <- это реальный путь к файлу приватного ключа
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\m.prokazin\\Documents\\tmp\\key-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Debian-10+deb9u7
debug1: match: OpenSSH_7.4p1 Debian-10+deb9u7 pat OpenSSH* compat 0x04000000
debug1: Authenticating to <ip сервера>:22 as 'github-deployer'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:g30wkiuNuaw6RZVbq0F0EsRyA1Gw8vbHfNruCF7iAS0
debug1: Host '<ip сервера>' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\m.prokazin/.ssh/known_hosts:41
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:lvQ7LKb8X8XS/Gx5TmsldZ+aqwyAl6teujJB+dTBaYI C:\\Users\\m.prokazin\\Documents\\tmp\\key
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
github-deployer@<ip сервера>: Permission denied (publickey,password).

这整个情况也在我按计划连接以上传更新的机器上重现。

可能是什么问题呢?

windows
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-06-23 19:28:24 +0000 UTC

如何知道 users 表中的 expiry_date 列是否已更改?

  • 1

我在 Oracle 方面面临着一个非常具体的挑战。
我需要证明某个expiry_date表列中的值在dba_users一定时间内(上周末)没有发生变化。

我对 Oracle 没有太多经验,所以我不确定,但似乎禁用了一个名为“审计”的功能。

所以,我需要任何方法来检查指定表中是否有字段更改。我已经尝试解析表格user_sessions(我想检查相关期间的会话),但无法得到准确的答案。

oracle
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-11-14 22:22:04 +0000 UTC

如何创建与另一个命名空间中定义的对象的绑定?

  • 0

在使用一个类库在 WPF 中开发图形界面的过程中,我遇到了一个问题:我不明白如何将 Configuration 对象作为静态资源绑定到图形界面的元素上。
写道:

<Window.Resources>
    <Configuration x:Key="config"/>
</Window.Resources>

但这不会编译,尽管配置在 C# 代码中是完全可见的,但在标记中却没有。
我试图xmlns:lib通过类比来描述命名空间xmlns:local

<Window x:Class="GUI.MainWindow"
    <…>
    xmlns:local="clr-namespace:GUI"
    xmlns:lib="clr-namespace:ClassLibrary">

尽管如此,仍显示两个错误:

  • XDG0008: The name "Configuration" does not exist in the namespace "clr-namespace:ClassLibrary".

  • XLS0414: The type 'lib:Configuration' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

如何解决?

c#
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-08-22 15:27:34 +0000 UTC

C# 中是否存在隐含(逻辑结果)运算符?

  • 2

我找不到如何编写 C# 隐含运算符。

c#
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-09-05 01:52:27 +0000 UTC

如何使用正则表达式在不成对(“”和“”)引号中查找引号?

  • 0

您只需要在文本中找到引号。确实,一切,在什么情况下,它通常会是什么样的文本是未知的。
我的天才足以应付这样一个常规赛:

([“”]|[«»]|["]){1}.{2,}?\1

它有效,但仅适用于普通报价,但如何处理其余部分?

例如:

“休息——进来!酸奶油——进来!鱼——进来!”
“我要去大溪地……你没去过大溪地吗?”
“海地,海地……我们不在任何海地!
我们在这里也吃得很饱。”
“亲子之家……Start-a-alo开始了……”

python-3.x
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-07-10 11:50:11 +0000 UTC

如何在 C# 中描述 PowerShell cmdlet 的文档?

  • 8

我不明白 Get-Help 文档的来源,以及如何为我的 cmdlet 编写它。

c#
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-04-19 16:19:26 +0000 UTC

为什么从类实现文件中看不到头文件?(C++ CLI)

  • 0

我正在学习 C++ CLI。我只是想创建一个Microsoft.Xna.Framework.Game继承和覆盖几个方法的类。
创建了一个头文件,如下所示:

//Game1.h
#include "stdafx.h"
#pragma once
namespace CLRGame {
    public ref class Game1 : public Microsoft::Xna::Framework::Game
    {
    public:
        Game1();
    private:
        Microsoft::Xna::Framework::GraphicsDeviceManager ^ graphics;
        Microsoft::Xna::Framework::Graphics::SpriteBatch ^spriteBatch;
    protected:
        void Initialize() override;
        void LoadContent() override;
        void UnloadContent() override;
        void Update(Microsoft::Xna::Framework::GameTime ^gameTime) override;
        void Draw(Microsoft::Xna::Framework::GameTime ^gameTime) override;
    };
}

描述了实现:

//Game1.cpp
#include "Game1.h"
#include "stdafx.h"
using namespace Microsoft::Xna::Framework;
using namespace Microsoft::Xna::Framework::Graphics;
using namespace Microsoft::Xna::Framework::Design;
using namespace Microsoft::Xna::Framework::Input;

namespace CLRGame {
    Game1::Game1()
    {
        graphics = gcnew GraphicsDeviceManager(this);
        Content->RootDirectory = "Content";
    }

    void Game1::Initialize()
    {
        Game::Initialize();
    }

    void Game1::LoadContent()
    {
        Game::LoadContent();
        spriteBatch = gcnew SpriteBatch(GraphicsDevice);
    }

    void Game1::UnloadContent()
    {
        Game::UnloadContent();
    }

    void Game1::Update(Microsoft::Xna::Framework::GameTime ^gameTime)
    {
        Game::Update(gameTime);
        KeyboardState keyboardState = Keyboard::GetState();
        if (keyboardState.IsKeyDown(Keys::Escape)) {
            Exit();
        }
    }

    void Game1::Draw(Microsoft::Xna::Framework::GameTime ^gameTime)
    {
        Game::Update(gameTime);
        GraphicsDevice->Clear(Color::Bisque);

    }
}

简而言之,我只是尝试在创建后立即重复 MonoGame (C#) 项目结构。
Intellisense(VS 2017 Enterprise)并没有发誓,但是,当我尝试编译这个优点时,我得到了一堆错误,这些错误与对应的 .h 在 .cpp 文件中不可见这一事实有关: Visual Studio 中错误列表的屏幕截图

如您所见,首先Ошибка C2653 Game1: не является именем класса или пространства имен CLRPP。
我没有触及项目的设置、编译器以及一般的任何设置。
项目结构:
Visual Studio 解决方案资源管理器的屏幕截图

我不知道该做什么以及它可以与什么联系起来。

c++
  • 1 个回答
  • 10 Views
Martin Hope
bearpro
Asked: 2020-04-05 22:44:46 +0000 UTC

如何为可重用的 XAML 元素创建模板(在 C# UWP 应用中)?

  • 1

也就是说,在我的应用程序中,您需要制作一种磁带,其中包含许多具有结构的元素:

Grid>Text, Image, Text / 

因此,我深知必须以某种方式创建此模板,然后在 C# 代码中使用它。

但是谷歌什么都搜不到,自己也没有完成。我尝试使用此模板创建一个页面,然后每次在带有功能区的页面代码中使用该模板创建一个新的页面实例,并从那里获取网格。但是,当我尝试向 StackPanel 的子元素添加网格时,我发现错误“元素已经是另一个元素的子元素”,这是完全可以预测和自然的,而且我的路径本身有点奇怪。

怎么做才对?

c#
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5