本文整理汇总了VB.NET中Microsoft.SqlServer.Server.IBinarySerialize.Write方法的典型用法代码示例。如果您正苦于以下问题:VB.NET IBinarySerialize.Write方法的具体用法?VB.NET IBinarySerialize.Write怎么用?VB.NET IBinarySerialize.Write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了IBinarySerialize.Write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Write
' The binary layout is as follows:
' Bytes 0 - 19: string text, padded to the right with null characters
' Bytes 20+: Double value
Public Sub Write(ByVal w As System.IO.BinaryWriter) _
Implements Microsoft.SqlServer.Server.IBinarySerialize.Write
Dim maxStringSize As Integer = 20
Dim stringValue As String = "The value of PI: "
Dim paddedString As String
Dim value As Double = 3.14159
' Pad the string from the right with null characters.
paddedString = stringValue.PadRight(maxStringSize, ControlChars.NullChar)
' Write the string value one byte at a time.
Dim i As Integer
For i = 0 To paddedString.Length - 1
w.Write(paddedString(i))
Next
' Write the double value.
w.Write(value)
End Sub