tags:

views:

540

answers:

2

I need to use a byte array as a profile property in a website. Normally I would declare the type as system.string or system.int32 but I have no idea what the type if for a byte array.

EDIT: I need to use this as profile property that is declared in the web.config like below:

<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  A: 

I'm coming from a C# background, so my answer won't be precise, but I think you want something like:

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

Apparently vb wants it declared as System.Byte[] in the web.config

William
It's not VB - it's the framework. System.Byte[] is the name of the type from the CLR and framework perspective. It happens to be valid in C# as well, but that's *almost* coincidental (and the same isn't true for generic types, for example).
Jon Skeet