2008-11-19 26 views
0

我需要使用一个字节数组作为网站中的配置文件属性。通常我会声明类型为system.string或system.int32,但我不知道类型是什么字节数组。什么是字节数组的系统类型 - asp.net?

编辑:我需要使用在像下面的web.config文件中声明此为配置文件属性:

<profile defaultProvider="ProfileProvider" enabled="true"> 
    <properties> 
      <add name="Username" allowAnonymous="false" type="System.String" /> 
      <add name="LoginToken" allowAnonymous="false" type=" System.Byte()" /> 
     </properties> 
</profile> 

回答

1

显然VB希望它在web.config

+1

声明为System.Byte []这不是VB - 它的框架。 System.Byte []是CLR和框架透视图中类型的名称。它恰好在C#中也是有效的,但这几乎是巧合的(例如对于泛型类型也是如此)。 – 2008-11-19 07:09:26

1

我从C#背景的,所以我的答案不准确,但我想你想要的东西,如:

system.byte[] myByteArray = new system.byte[50](); 
myByteArray[0] = 1; 
myByteArray[2] = 20; // etc, etc.