小编Bil*_*med的帖子

用C#显式杀死线程

我有C#代码,我在调用SAP BAPI,但有时需要很长时间才能获得响应.

我只能等待3秒才能得到回复.如果它在3秒内没有返回,那么我想终止呼叫并继续下一行.

funcArtike2.SetValue("CLI", CLI);             
funcArtike2.Invoke(rfcDest);

string CA = funcArtike2["CONTRACT_ACCOUNT"].GetValue().ToString().Trim() != "".ToString() ? funcArtike2["CONTRACT_ACCOUNT"].GetValue().ToString().Trim() : "X";
//IRfcStructure RETURN = funcArtike2["RETURN"].GetStructure();
string BP = funcArtike2["BUSINESS_PARTNER"].ToString().Substring(funcArtike2["BUSINESS_PARTNER"].ToString().IndexOf("=")+1);
Run Code Online (Sandbox Code Playgroud)

funcArtike2.Invoke(rfcDest); 是等待3秒后我想跳过的声明.

c# multithreading

2
推荐指数
1
解决办法
168
查看次数

标签 统计

c# ×1

multithreading ×1