用VB6.0写的天地玄门服务端的启动程序

 

 天地玄门的服务端程序是由C++开发的,一共要启动7个服务端窗口。其中第六个是主服务端程序,要等第六个服务端程序 出现 process message count =0 的时候才能 算是真正的启动成功。

VB窗体代码如下:

Const CC_不关闭窗口 As String = " &&pause"

Private Sub Command1_Click()
 
  Shell "namesvr.bat" & CC_不关闭窗口, vbNormalFocus
  Command1.Enabled = False
End Sub

Private Sub Command2_Click()

  Shell "namesvr_frontsvr.bat" & CC_不关闭窗口, vbNormalFocus
    Command2.Enabled = False
End Sub


Private Sub Command3_Click()
  Shell "rundbserver.bat" & CC_不关闭窗口, vbNormalFocus
    Command3.Enabled = False
End Sub

Private Sub Command4_Click()

  Shell "runmailsvr.bat" & CC_不关闭窗口, vbNormalFocus
    Command4.Enabled = False
End Sub

Private Sub Command5_Click()


  Shell "runwritesvr.bat" & CC_不关闭窗口, vbNormalFocus
    Command5.Enabled = False
End Sub

Private Sub Command6_Click()

  Shell "runmwserver.bat" & CC_不关闭窗口, vbNormalFocus
    Command6.Enabled = False
End Sub

Private Sub Command7_Click()

  Shell "runfrontsvr.bat" & CC_不关闭窗口, vbNormalFocus
    Command7.Enabled = False
End Sub


Private Sub Command8_Click()
   Label1.Caption = "服务器启动中,请稍等..."
  List1.Clear
            Call Command1_Click
             List1.AddItem Command1.Caption
             SleepEx 5000
            Call Command2_Click
             List1.AddItem Command2.Caption
             SleepEx 5000
            Call Command3_Click
             List1.AddItem Command3.Caption
             SleepEx 5000
            Call Command4_Click
             List1.AddItem Command4.Caption
             SleepEx 5000
            Call Command5_Click
             List1.AddItem Command5.Caption
             SleepEx 5000
            Call Command6_Click
             List1.AddItem Command6.Caption
             SleepEx 5000
            Call Command7_Click
             List1.AddItem Command7.Caption
             SleepEx 5000
             Command8.Enabled = False
             Label1.ForeColor = vbBlue
             Label1.Caption = "服务器启动完毕"
End Sub

模块代码如下,就一个延时函数,不卡UI的

Private Declare Function timeGetTime Lib "winmm.dll" () As Long

Sub SleepEx(T As Long)
    Dim time1 As Long
    time1 = timeGetTime
    Do
    DoEvents
    Loop While timeGetTime - time1 < T
End Sub

交流Q 1016058890 天地玄门

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

侠客软件开发

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值