问题描述
在C#中如何取决于用户输入的串行端口通信中如何在列表框中显示DTR ON TIME
和DTR OFF TIME
?
像例子
1.总时间= 20分钟(i/p)文本框
2. DTR ON
= 2000毫秒(i/p)文本框
3. DTR OFF
= 5000毫秒(i/p)文本框
4.开始BUTTON
5. LISTBOX
(显示启用/禁用消息的时间)
请给我发送C#代码plssssssssssssssssss
嘿,使用线程概念,如两个线程的start sleep start
How to display DTR ON TIME
and DTR OFF TIME
in listbox in serial port communication that depends on user input, in C#?
like example
1. total time =20 minutes(i/p)Textbox
2. DTR ON
=2000 milliseconds(i/p)Textbox
3. DTR OFF
=5000 milliseconds (i/p)Textbox
4. start BUTTON
5. LISTBOX
(Show the times with message enable/disable)
JUST SEND ME THE C# CODE plsssssssssssssssssss
hey use the thread concept like start sleep start for two threads
推荐答案
listbox.Items.Add("DTR ON TIME");
listbox.Items.Add("DTR OFF TIME");
认真地说,您是否要求打开/关闭DTR的时间?
如果是这样,那将是这样的:
Seriously though, are you asking for the time at which DTR was turned on/off?
If so, that would go something like this:
listbox.Items.Add(string.Format("{0} - DTR OFF", DateTime.Now.ToString("yyyyMMdd HH:mm:ss")));
listbox.Items.Add(string.Format("{0} - DTR ON", DateTime.Now.ToString("yyyyMMdd HH:mm:ss")));
当然,您可能必须处理一个自定义事件并调用适当的委托才能将适当的文本添加到列表框中,但是您并不需要输入代码,因此我假设您知道自己在做什么.在做.
Of course, you''d probably have to handle a custom event and invoke the proper delegate in order to add the appropriate text to the listbox, but you didn''t ask for code for that, so I assume you know what you''re doing.
这篇关于如何在串口通讯的列表框中显示DTR ON TIME和DTR OFF TIME?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!