zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    java中的Runtime类
    java web 三大核心组件Filter
    springBoot 整合mybaits 逆向工程
    java内存区域之程序计数器
    spring mvc 注解整理(一)
    ELK 日志查询分析nginx日志
    npm 淘宝镜像
    两种网页截图功能
    url 编码解码
    对防火墙的理解
  • 原文地址:https://www.cnblogs.com/lx1988729/p/3124352.html
Copyright © 2011-2022 走看看