CSharpTest.Net
ToByteArray() Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Data Namespace > DbGuid Structure > ToByteArray Method : ToByteArray() Method

Glossary Item Box

Big-endian byte array, not compatible with System.Guid.ToByteArray.

Syntax

Visual Basic (Declaration) 
Public Overloads Function ToByteArray() As Byte()
C# 
public byte[] ToByteArray()

Example

Library/Library.Test/TestDbGuid.cs

C#Copy Code
DbGuid testA = DbGuid.NewGuid();
byte[] bytes = testA.ToByteArray();
DbGuid testB = new DbGuid(bytes);
Assert.AreEqual(testA, testB);
VB.NETCopy Code
Dim testA As DbGuid = DbGuid.NewGuid()
Dim bytes As Byte() = testA.ToByteArray()
Dim testB As New DbGuid(bytes)
Assert.AreEqual(testA, testB)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys