我想在.net应用程序中使用一些VB6代码。它使用一个不再可用的函数AscB。我需要在.net中使用什么?在VB.net中VB6函数AscB等效
的函数如何被使用(在从端部第三行功能)提取物....
' Combine each block of 4 bytes (ascii code of character) into one long
' value and store in the message. The high-order (most significant) bit of
' each byte is listed first. However, the low-order (least significant) byte
' is given first in each word.
lBytePosition = 0
lByteCount = 0
Do Until lByteCount >= lMessageLength
' Each word is 4 bytes
lWordCount = lByteCount \ BYTES_TO_A_WORD
' The bytes are put in the word from the right most edge
lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE
lWordArray(lWordCount) = lWordArray(lWordCount) Or _
LShift(AscB(Mid(sMessage, lByteCount + 1, 1)), lBytePosition)
lByteCount = lByteCount + 1
Loop
由于
VB6代码看起来很奇怪。我很惊讶它不是AscB(MidB而不是AscB(Mid。[文档](http://msdn.microsoft.com/en-us/library/aa445073(v = vs.60).aspx))。 sMessage字符串是否包含?是否在中文或韩文这样的双字节代码页上运行? – MarkJ 2012-04-20 19:29:46