用参数调用子的问题 [英] problem with calling a sub with parametres

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

问题描述

我有一个看起来像这样的子程序

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.

看看
One way is to use ParameterizedThreadStart.

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屋!

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