From vbs to Asp.net.

Source: Internet
Author: User

Vbs can be used on the web with just a few changes, but it is difficult to find the type of the object. It is always uncomfortable to use the object.

Dim WMI

Set WMI =   GetObject ( " Winmgmts: " )
Set Objs = WMI. instancesof ( " Win32_process " )

For   Each OBJ in objs
Enum1 = Enum1 + OBJ. Description +   CHR ( 13 ) +   CHR ( 10 )
Next

 

Dim WMI As   Object
WMI =   GetObject ( " Winmgmts: " )
Dim Objs As   Object   = WMI. instancesof ( " Win32_process " )
Dim OBJ As   Object

' List Processes
For   Each OBJ In Objs
Response. Write (obj. description)
Response. Write ( " <P> " )
Next

 

Strcomputer =   " . "
Set Obw.miservice =   GetObject _
( " Winmgmts :\\ "   & Strcomputer &   " \ Root \ cimv2 " )
Set Colprocesslist = Ob1_miservice. execquery _
( " Select * From win32_process where name = 'qq.exe' " )
' Terminate QQ Process
For   Each Objprocess in colprocesslist
Objprocess. Terminate ()
Next

 

Dim Strcomputer As   String   =   " . "
Dim Obw.miservice As   Object   =   GetObject _
( " Winmgmts :\\ "   & Strcomputer &   " \ Root \ cimv2 " )
Dim Colprocesslist As   Object   = Ob1_miservice. execquery _
( " Select * From win32_process where name = 'qq.exe' " )
Dim Objprocess As   Object
For   Each Objprocess In Colprocesslist
Objprocess. Terminate ()
Next
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.