用参数调用子的问题 [英] problem with calling a sub with parametres
本文介绍了用参数调用子的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个看起来像这样的子程序
I have a subroutine that looks like that
Function GetCodekeyFunction(ByVal realstring As String, ByVal en As String, ByVal encrpyed As String) As String
'code here
End Function
我想从另一个线程调用它
and I want to call it from another thread
Dim threadd As New System.Threading.Thread(AddressOf GetCodekeyFunction("F", "F", "F"))
但这不起作用!
but it doesn''t work!
How can I declare a thread that calls a sub or function with parameters??
推荐答案
一种方法是使用ParameterizedThreadStart
.
看看 ^ ]线程,或搜索互联网.请注意可能包含在匹配列表中的MSDN页面,因为我认为它们使用的示例是错误的.
One way is to useParameterizedThreadStart
.
Take a look at this[^] thread, or search the internet. Be careful with the MSDN pages that might be in the list of hits, since I believe the example they use to be incorrect.
这篇关于用参数调用子的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文