网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

vb点虐 获取关机 vbnet dir

小技巧:VB.NET实现关机和重新启动

Private Declare Function ExitWindowsEx Lib user (ByVal uFlags As Integer ByVal dwReserved As Integer) As IntegerConst EWX_FORCE As Short = Const EWX_LOGOFF As Short = Const EWX_REBOOT As Short = Const EWX_SHUTDOWN As Short = Dim retval As Integer 定义Esc按键Const VK_ESCAPE As Short = H BsPrivate Sub Command _Click(ByVal eventSender As System Object ByVal eventArgs As System EventArgs) Handles Command ClickIf Option Checked Then 注销当前用户retval = ExitWindowsEx(EWX_FORCE )ElseIf Option Checked Then 关闭计算机retval = ExitWindowsEx(EWX_SHUTDOWN )ElseIf Option Checked Then 重新启动retval = ExitWindowsEx(EWX_REBOOT )End IfEnd SubPrivate Sub Command _Click(ByVal eventSender As System Object ByVal eventArgs As System EventArgs) Handles Command ClickMe Close()End Sub 按Esc键时 结束应用程序Private Sub Form _KeyPress(ByVal eventSender As System Object ByVal eventArgs As System Windows Forms KeyPressEventArgs) Handles MyBase KeyPressDim KeyAscii As Short = Asc(eventArgs KeyChar)If KeyAscii = VK_ESCAPE ThenMe Close()End IfIf KeyAscii = TheneventArgs Handled = TrueEnd IfEnd Sub本实例通过使用ExitWindowEx()API函数来达到关机和重新启动的目的 在ExitWindowEx()函数中 参数uFlags指定要进行何种操作 在表 中列出了参数uFlags的值及其说明 表  参数uFlags的值及说明 lishixinzhi/Article/program/net/201311/13585

创新互联建站坚持“要么做到,要么别承诺”的工作理念,服务领域包括:成都做网站、网站建设、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的东平网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!

VB.NET 中怎么获取开机时间与关机时间

2000以上系统系统日志都有记录的,直接读系统日志就可以了,多此一举

请问VB.NET的关机语句是?

这是点击Option 你可以

用个msgbox函数 点击YES时候运行关机代码即可

Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Integer, ByVal dwReserved As Integer) As Integer 

Const EWX_FORCE As Short = 4

Const EWX_LOGOFF As Short = 0

Const EWX_REBOOT As Short = 2

Const EWX_SHUTDOWN As Short = 1

Dim retval As Integer

' 定义Esc按键

Const VK_ESCAPE As Short = H1Bs

Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click

If Option1.Checked Then

' 注销当前用户

retval = ExitWindowsEx(EWX_FORCE, 0) bitsCN.Com

ElseIf Option2.Checked Then

' 关闭计算机

retval = ExitWindowsEx(EWX_SHUTDOWN, 0)

ElseIf Option3.Checked Then

' 重新启动

retval = ExitWindowsEx(EWX_REBOOT, 0)

End If

End Sub

Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click

Me.Close()

End Sub

' 按Esc键时,结束应用程序

Private Sub Form1_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress

Dim KeyAscii As Short = Asc(eventArgs.KeyChar)

If KeyAscii = VK_ESCAPE Then BBS.bitsCN点抗 网管论坛

Me.Close()

End If

If KeyAscii = 0 Then

eventArgs.Handled = True

End If

End Sub


网站名称:vb点虐 获取关机 vbnet dir
网站网址:http://bjjierui.cn/article/ddjhhei.html

其他资讯