如何在新类型中声明数组?

时间:2012-11-05 15:39:10

标签: c# powershell

我想在计算机类型中声明一个数组,如下面的代码

Add-Type @"
public struct Computer {
    public string Name;
    public string ProductName;
    # declare array
}

谢谢!

1 个答案:

答案 0 :(得分:2)

在C#中声明字符串数组的字段:

public string[] YourArrayName