如何调用一个在线程中带有多个参数的方法? [英] How to call a method that takes multiple parameters in a thread?

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

问题描述

我正在构建C#桌面应用程序. 如何调用一个在线程中采用多个参数的方法. 我有一个名为Send(string arg1,string arg2,string arg3)的方法,我需要使用一个名为SendingThread的线程来调用此方法.有人可以帮忙吗? 任何帮助将不胜感激.

I am building a C# Desktop application. How do I call a method that takes multiple parameters in a thread. I have a method called Send(string arg1, string arg2, string arg3) , I need to call this method using a thread called SendingThread. Can anyone help out with this? Any help will be much appreciated.

推荐答案

Thread thread = new Thread(() => Send(arg1, arg2, arg3));
thread.Start();

这篇关于如何调用一个在线程中带有多个参数的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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