如何调用公共共享功能 [英] How to call public shared function

查看:133
本文介绍了如何调用公共共享功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的程序中,我具有公共共享功能........

Hai all,

In my program i am having public shared function...........

Public Shared Function ComputeCrc(ByVal data As Byte()) As UInt16
      Dim crc As UShort = &HFFFF

      For Each datum As Byte In data
          crc = CUShort((crc >> 8) Xor CrcTable((crc Xor datum) And &HFF))
      Next

      Return crc
  End Function



我需要用我的字符串"str"来调用此函数.
请给一些指示..........


谢谢


[edit]已添加代码块,将我的内容作为纯文本..."选项已禁用-OriginalGriff [/edit]



I need to call this function with my string "str".... and also carry the return value ....... HOW?
Please give some instructions..........


Thank You


[edit]Code block added, "Treat my content as plain text..." option disabled - OriginalGriff[/edit]

推荐答案

尝试:
Dim myString As String = "assdfdfgsdfg"
Dim retval As UInt16 = [MyClass].ComputeCrc(System.Text.Encoding.ASCII.GetBytes(myString))


这篇关于如何调用公共共享功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆