vb.net 相当于“private void (string text)”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35612920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 19:44:24  来源:igfitidea点击:

vb.net equivalent to "private void (string text)"

c#asp.netvb.net

提问by SRock2016

This might seem real simple but I am I'm building a website with help online but the code is in c#. I'm wondering what the equivalent vb code is? I'm looking for something along the lines of: "Private sub checkNo(string text)"but its giving me errors. Many thanks in advance.

这可能看起来很简单,但我正在使用在线帮助构建一个网站,但代码是在 c# 中的。我想知道等效的 vb 代码是什么?我正在寻找类似以下内容的内容: “私人子检查号(字符串文本)”,但它给了我错误。提前谢谢了。

Private void checkNo(string text)

{

}

回答by Mark Brackett

VB.NET uses Subfor voidreturning functions:

VB.NETSub用于void返回函数:

Private Sub checkNo(text as String)
End Sub

For future reference, if you've inherited a VB.NET code base, an online converterwill generally handle the basics of C# to VB.NET conversion pretty well.

为了将来参考,如果您继承了 VB.NET 代码库,在线转换器通常可以很好地处理 C# 到 VB.NET 转换的基础知识。