小编usr*_*260的帖子

C# 运行进程,参数中有多个空格

我正在尝试启动一个在参数中包含多个空格的进程。传递的参数是动态构建的。例如:

// These three strings will be built dynamically
string consolePath = "C:\\My Path\\nunit3-console.exe"
string dll = "C:\\My Path\\My.Test.dll"
string where = "--where \"test == My.Test.Example \""

string cmdText = $" \"{consolePath }\" \"{dll}\" {where}";
//cmdText = "\"C:\\My Path\\nunit3-console.exe\" \"C:\\My Path\\My.Test.dll\" --where \"test == My.Test.Example \""

var processInfo = new ProcessStartInfo("cmd.exe", $"/c {cmdText}");
processInfo.CreateNoWindow = false;
Process process = Process.Start(processInfo);
process.WaitForExit();
process.Close();
Run Code Online (Sandbox Code Playgroud)

这不起作用,因为第一个空格之外的任何文本都将被忽略。我将收到一条消息,例如“C:\My”不是内部或外部命令、可运行的程序或批处理文件。

我想围绕参数添加括号,如所指出的在这里,但没有奏效。这样做的正确方法是什么?

c# windows command-line command escaping

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

如何删除 Summernote 工具提示 v.0.8.2

我正在尝试从 Summernote 的工具栏中删除工具提示。我尝试了以下方法,以前有效,但现在更新到 0.8.2 后不起作用。删除工具提示的正确方法是什么?

$("#myNote").summernote({
            toolbar: [
                ['para', ['ul']] // I want to remove this tooltip
            ],
            focus: true
        });
$('.note-editor [data-event="insertUnorderedList"]').tooltip('disable'); 
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.2/summernote.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.2/summernote.css" rel="stylesheet"/>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet"/>


<div id="myNote"></div>
Run Code Online (Sandbox Code Playgroud)

javascript jquery summernote

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

Nunit没有为每个文本夹具调用一次设置

我是Nunit的新手,我正在尝试运行2个测试夹具,A&B.在每个夹具中,我为每个夹具都有一个独特的安装方法.但是,当我在Visual Studio中的"测试资源管理器"中单击"全部运行"时,将调用Fixture A的测试设置(首先执行),并忽略Fixture B的设置.通过命令行运行所有测试时,我也会得到相同的行为.以下是我的代码:

夹具A.

[TestFixture]
public class A
{      
        [SetUp]
        public void SetupTest()
        {
            // ...Setup for Fixture A
        }                

        [Test, Order(1)]
        public void TestForFixtureA()
        {
            // ...perform test
        }
}
Run Code Online (Sandbox Code Playgroud)

夹具B

[TestFixture]
public class B
{      
        [SetUp]
        public void SetupTest()
        {
            // ...Setup for Fixture B
        }                

        [Test]
        public void TestForFixtureB()
        {
            // ...perform test
        }
}
Run Code Online (Sandbox Code Playgroud)

每个Fixture执行Setup方法的正确方法是什么?

c# nunit automated-tests

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

jquery Datatables 复选框获取所有选中的行

我有一个数据表,我试图在其中获取所有选中的行。该表具有行分组并使用来自gyrocode的复选框插件。我已经尝试了api上列出的代码,但我没有运气。无论选择什么,我都只会返回第一条记录。我用于的代码如下所示:

var tbl;
$(document).ready(function (){
          tbl = $('#example').DataTable({
            columnDefs: [{
                targets: 0,
                data: 2,
                'checkboxes': {
                    'selectRow': true
                }
            },
            { "visible": false, "targets": 1 }],
            select: {
                style: 'multi'
            },
            order: [[1, 'asc']],
            iDisplayLength: 10,
            drawCallback: function () {
                var api = this.api();
                var rows = api.rows({ page: 'current' }).nodes();
                var last = null;

                api.column(1, { page: 'current' }).data().each(function (group, i) {
                    if (last !== group) {
                        $(rows).eq(i).before(
                            '<tr class="group"><td colspan="6">' + group + '</td></tr>' …
Run Code Online (Sandbox Code Playgroud)

javascript checkbox jquery datatables

2
推荐指数
2
解决办法
3万
查看次数

Jstree上下文菜单在select_node上单击右键更改事件

我试图找到一种方法,我可以changed在加载动态上下文菜单(右键单击)时抑制jstree中的事件.我知道您可以在上下文菜单中禁止select_node事件,但我需要获取我右键单击的节点的节点ID.(因此需要使用select_node).我知道你可以在定期打电话时压制这个改变的事件select_node,但我不确定如何在右键点击时这样做.我在上下文菜单中尝试了以下操作select_node,但它不起作用:

$(function () {
    $('#myTree').jstree({
        "core": {
            "themes": {
                "variant": "small",
                "icons": false
            }
        },
        "contextmenu": {
            "items": reportMenu(node),      //builds context menu based on selected node
        },
        "plugins": ["contextmenu", "changed"]
    });
});
$("#myTree").bind('select_node.jstree', function (event, data) {
// Does not work, changed event still fires.
    $("#myTree").jstree().select_node(data.node.id, true);
});
Run Code Online (Sandbox Code Playgroud)

我正在寻找可能的替代方案之一:

  1. 如何changed在上下文菜单调用时抑制事件select_node
  2. 如何在不调用select_node事件的情况下获取我正确点击的节点的id (即如果我将上下文菜单设置为'select_node': false,如何捕获select节点)?

javascript jquery contextmenu jstree

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

Summernote删除调整大小栏

我使用summernote 0.8.2,我想在像所示的一个文本编辑器的底部移除调整大小酒吧在这里.我尝试了下面列出的选项.有谁知道这样做的正确方法是什么?

$("#summernote").summernote({
    toolbar: [
        ['para', ['ul']]
    ],
    focus: true,
    disableResize: true,            // Does not work
    disableResizeEditor: true,      // Does not work either
    resize: false                   // Does not work either
});
$('.note-statusbar').hide()             // Does not work either
Run Code Online (Sandbox Code Playgroud)

javascript css3 summernote

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