小编Ale*_*Ras的帖子

是否可以在任务管理器中为 .NET Core Web 应用程序设置显示名称?

我有一个 .Net Core 2.0 Web 应用程序,我希望在任务管理器中显示该名称。目前显示的是.NET Core Host

在此输入图像描述

我发现了这个问题,但不幸的是,无法更改程序集信息,因为该窗口甚至没有显示(我认为这是因为它是 .NET Core 2.0 应用程序而不是 .NET Framework 4.x 应用程序)。

在此输入图像描述

还有其他方法可以在任务管理器中显示应用程序的标题吗?

c# windows visual-studio

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

NaCL 库中的 Curve25519 是否已被替换?

我正在使用 NaCL 库,我喜欢它,但我想知道如果需要更强的加密,需要什么才能用不同的、更强的曲线替换 Curve25519。

我确实知道新库与 NaCL 不兼容。

c encryption cryptography libsodium

5
推荐指数
0
解决办法
272
查看次数

是否有一种简单的方法可以在不使用循环的情况下创建相同对象的列表?

我目前有这样的事情:

public class Person
{
    public string Firstname { get; set; }

    public string Lastname { get; set; }
}

public List<Person> CreatePersons(int numberOfPersons)
{
    var persons = new List<Person>();

    for (int i = 0; i < numberOfPersons; i++)
    {
        persons.Add(new Person())
    }

    return persons;
}
Run Code Online (Sandbox Code Playgroud)

我知道,如果我要使用,array那么我可以这样做:

var persons = new Person[numberOfPersons];
Run Code Online (Sandbox Code Playgroud)

我的问题是:

  • 有没有使用循环创建对象列表的简单/直接方法?

我猜一个数组可能在内部完全相同,使用一个循环来创建这个数组,但使用不同的表示法.但现在这不是一个问题,对于这个问题,我只是对一个更简单的符号感兴趣.

c# loops

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

Conditional types for nullable in Typescript

I want to check if a type is nullable or not, and if it has a conditional type on the value.

I tried implementing

type IsNullable<T> = T extends null ? true : false;
Run Code Online (Sandbox Code Playgroud)

However, it does not seem to work

type test = IsNullable<number> // Returns false as it should
type test = IsNullable<number | null> // Returns false when it should be true
Run Code Online (Sandbox Code Playgroud)

What's the proper way of checking if a type is nullable? I tried with T …

types nullable conditional-statements typescript

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