public static void Main()
{
Thread t = new Thread(Bbc);
t.Start();
read();
}
private static void Bbc()
{
while(true)
{
if (PublicVlaues.rfid == 1)
Console.WriteLine("1");
else Console.WriteLine("5");
}
}
private static void read()
{
while (true)
{
string s = Console.ReadLine();
PublicVlaues.rfid = int.Parse(s);
}
}
}
class PublicVlaues
{
public static int rfid = 0;
public static byte[] IRFIDReadBytr = new byte[] { };
}
![](https://profile-avatar.csdnimg.cn/518123cf899246b59b8ca35ff8057aa2_weixin_44420151.jpg!4)
线程中接收外部动态参数
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
悬赏问题
- ¥20 你对Pyton有信心吗?
- ¥15 知道这个是什么图吗,想知道制作详细做法,或者模版也行
- ¥15 CubeMX配置lwip实现TCP数据传输
- ¥15 关于#51单片机#的问题:不能用中断、定时器之类的辅助实现
- ¥15 blastfoam初学者尝试跑算例遇到问题
- ¥25 pyqt6常规布局问题!我刚学 有点难度!
- ¥20 基于ros2的orbslam3的实时运行
- ¥100 支付行业技术人员来一个。常年包养
- ¥15 kotlin multiplaform Compose项目 需要实现一个文件选择器获取手机上的文件
- ¥15 Python没爬取到数据,求看这个是什么原因