• 您的位置我爱Aspx >> VB.Net >> VB.NET开发扫描客户端服务工具
  • VB.NET开发扫描客户端服务工具

  • 作者:aspxer  来源:internet  日期:2007-5-20 14:01:18  关键字:.net
  • Imports System.Xml

    Imports System.Threading

    Public Class GetStatus

    Private IServiceName As String ‘服务的名称

    Private IMachineIP As String ‘IP地址

    Private ITable As String ‘在DATESET中的表名

    ‘构造函数

    Sub New(ByVal Ip As String, ByVal SvcName As String, ByVal updatetable As String)

    IMachineIP = Ip

    IServiceName = SvcName

    ITable = updatetable

    End Sub

    ‘每个线程所运行的方法,用于得到服务的状态,如果状态不正常则触发另一线程得到该IP的信息

    Sub GetStausF()

    Dim ServiceP As New ServiceController() ‘实例化一个ServiceController类

    ServiceP.MachineName = IMachineIP

    ServiceP.ServiceName = IServiceName

    Dim myRow As DataRow

    Dim status As String

    Dim Run As Boolean = False

    myRow = ds.Tables(ITable).NewRow

    Try

    If ServiceP.Status.ToString <> "Running" Then

    status = ServiceP.Status.ToString‘如果状态不是RUNNING则将状态赋予字符串变量

    我对这篇文章有话说?
  • 广告位招租,广告代号:content_468_15
  • 上一篇:在VB.NET中调试存储过程
    下一篇:消息队列在VB.NET数据库开发中的应用