VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



VB code with Window Network API

by Abid Khurshid Butt (2 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (9 Votes)

With this code your can Shutdown any Workstation connected on LAN (Local Area Network) od Windows NT/2000.
This code is very usefull for LAN applications. It will give an good idea to communicate with other worstations.

Inputs
Just Workstation Name to Shutdown
Assumes
User must know something about Windows API and some knowledge of Network.
Code Returns
Required Workstation will Shutdown
Side Effects
There no side effects for this code.
API Declarations
Private Declare Function InitiateSystemShutdown Lib "advapi32.dll" Alias "InitiateSystemShutdownA" (ByVal lpMachineName As String, ByVal lpMessage As String, ByVal dwTimeout As Long, ByVal bForceAppsClosed As Long, ByVal bRebootAfterShutdown As Long) As Long

Rate VB code with Window Network API

Private Sub Command1_Click()
  Dim a
  a = InitiateSystemShutdown(Trim(Text1.Text), "Hello", 0, 0, 1)
  MsgBox "Shutdown Completed"
End Sub

Download this snippet    Add to My Saved Code

VB code with Window Network API Comments

No comments have been posted about VB code with Window Network API. Why not be the first to post a comment about VB code with Window Network API.

Post your comment

Subject:
Message:
0/1000 characters