• Vb线程控制


    Dim thread As LedShow = New LedShow
    thread.iTransMode = 1
    thread.iConType = 3
    thread.iping = 1
    thread.Led_Ip = led_ip.ToString() '//LED网卡IP地址
    Dim th1 As Threading.Thread
    If type = "1" Then '//预约一笔警示信息
    thread.mesinfo = region + " " + groupname + " " + sender_name + " [APPT++1]!!"
    thread.ext = ext
    th1 = New Threading.Thread(New ThreadStart(AddressOf thread.SetLEDAPPT))
    th1.Start() '//开启线程
    Dim tcb As New TimerCallback(AddressOf th1.Abort) '建立一个终止线程的委托
    Dim objTimer As Timer '初始化定时器
    '建立一个定时器每10秒调用一个过程,并且只执行调用一次。tcb,终止线程的委托。100000ms,首次10s后调用。0,只调用一次(正数,多长时间调用一次)。
    objTimer = New Timer(tcb, Nothing, TimeSpan.FromSeconds(10000), TimeSpan.FromSeconds(0))
    objTimer.Change(TimeSpan.FromSeconds(10000), TimeSpan.FromSeconds(0))
    objTimer.Dispose() '释放定时器资源
    'th1.Abort() '终止线程
    'Threading.Thread.Sleep(10000) '线程等待10秒
    'th1.Join() '//等待线程结束运行下方的程式
    End If

  • 相关阅读:
    一款非常好用的范围滑动插件
    设置滚动条样式
    Qml 定义 constant
    qml 中 使用 shader
    Qt ImageProvider 的使用
    qt 汉化 国际化
    qt rcc 使用
    CentOS7/RHEL7 pacemaker+corosync高可用集群搭建
    Ubunt平台Qt出现:-1: error: cannot find -lgl
    排序-堆排序
  • 原文地址:https://www.cnblogs.com/lx1988729/p/3124352.html
Copyright © 2020-2023  润新知