小编Nas*_*imi的帖子

属性网格:如何在网格右侧设置每个属性的显示名称标签?

我已经实现了一个自定义属性网格,我想知道我是否可以从左到右更改每个属性的标签位置.

我的自定义属性网格显示属性,如图所示.

在此输入图像描述

我想改变它是这样的:

在此输入图像描述

这是Custom Property网格的主要代码

public class CustomPropertyGrid : PropertyGrid
{

    private System.ComponentModel.Container components = null;
    private ReperesentAttr representAttr;
    private myTab tab;
    public CustomPropertyGrid()
    {
        this.representAttr = new ReperesentAttr("", "");
        tab.SetRepresentAttr = this.representAttr;
        InitializeComponent();
        this.PropertySort = PropertySort.Alphabetical;
        this.RightToLeft = RightToLeft.Yes;


     //   this.

    }

    public ReperesentAttr SetRepresentAttr
    {
        set
        {
            representAttr = value;
            tab.SetRepresentAttr = this.representAttr;

        }
    }
    protected override void Dispose(bool disposing)
    {
        if (disposing)
        {
            if (components != null)
            {
                components.Dispose();
            }
        }
        base.Dispose(disposing);
    }

    #region Codice generato da …
Run Code Online (Sandbox Code Playgroud)

.net c# propertygrid customproperty winforms

5
推荐指数
1
解决办法
664
查看次数

如何通过 sudo 运行命令并通过 ssh .net c# 输入密码

我想在具有 Linux 操作系统的远程计算机上运行命令并获取结果。我正在使用 ssh .net 库通过 C# 代码进行连接。我可以连接并运行一些以前不需要使用“sudo”的命令。但我不知道如何运行需要由 sudo 运行的命令,因为在运行之后 - 例如 - “sudo iptables -L -n”我应该输入密码,但我不知道如何在执行后输入密码命令。

这是我的代码:

private void connectingToLinuxHost(string ip, string username, string password, int port)
{
    SshCommandLineRunner ssh = new SshCommandLineRunner(ip, username, password, port);
    ssh.Connect();
    string output1 = ssh.ExecuteCommand("ls");

    ssh.ExecuteCommand("sudo iptables -L -n");
    Thread.Sleep(1000);
    string output2 = ssh.ExecuteCommand(password);

    ssh.ExecuteCommand("sudo iptables -L -n \n");
    Thread.Sleep(1000);
    string output3 = ssh.ExecuteCommand(password);
}
Run Code Online (Sandbox Code Playgroud)

当这个函数运行时,我可以成功连接到远程电脑,输出1有正确的值,但输出2和输出3为空。实际上很明显,在 sudo 命令之后需要输入密码。我已经阅读了有关 ssh .net 的大多数问题。一些类似的问题仍未得到解答。

SSH .NET:冻结 sudo su - user2 (他或她不知道密码,但我知道我不知道如何通过代码输入)

如何使用 SSH.Net su? …

c# linux ssh ssh.net

4
推荐指数
1
解决办法
1万
查看次数

我应该通过哪些措施在MATLAB中设置高斯滤波器的大小?

我正在尝试使用MATLAB学习图像处理,我已阅读有关图像的过滤器.考虑这段代码:

gaussianFilter = fspecial('gaussian', [7, 7], 5)  ,
Run Code Online (Sandbox Code Playgroud)

这构建了一个7行和7列的高斯滤波器矩阵,标准偏差为5.因此,滤波器矩阵的大小为7 x 7.

该矩阵的大小如何在过滤时有效?(这个矩阵有什么作用?)

我应该通过哪些措施在代码中设置滤镜矩阵的大小?

matlab filtering signal-processing image-processing gaussian

3
推荐指数
1
解决办法
5603
查看次数

上下文无关语法和其他语法有什么区别?

哪些语法不是上下文无关的?请给我一些非上下文无关的例子。

Is this grammar context free?

A->aSb|aaS|aaaS|B
S->aSb|Bb|lambda
B->Bb|lambda
Run Code Online (Sandbox Code Playgroud)

programming-languages context-free-grammar

2
推荐指数
1
解决办法
4720
查看次数

在SSRS报告的矩阵表中按顺序设置行号

我有一份 SSRS 报告,其中包含矩阵表。该矩阵有一个名为 ItemId1 的行 Groups。我想向这个矩阵添加行号。当我添加表达式 RowNumber(nothing) 时,结果如下:

在此输入图像描述

当我添加表达式 RowNumber("ItemId1") 时,报告显示如下:

在此输入图像描述

我只想要基于行的行号,我的意思是我期望行号 2 而不是 7 (或 8)

reporting-services dynamics-365

1
推荐指数
1
解决办法
5503
查看次数