Results 1 to 13 of 13

Thread: Enable or disable internet connection of remote computers

Hybrid View

  1. #1
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Enable or disable internet connection of remote computers

    do you have any code so that the client can receive the data?
    Chris

  2. #2

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    61

    Exclamation Re: Enable or disable internet connection of remote computers

    VB Code:
    1. Client
    2.  
    3. Private Sub sckControlPanel_DataArrival(ByVal bytesTotal As Long)
    4. Dim Command As String, txtData As String
    5. Dim Position As Integer
    6.    
    7. On Error Resume Next
    8.     sckControlPanel.GetData txtData
    9.    
    10.     Position = InStr(1, txtData, "#")
    11.     Command = Left(txtData, Position - 1)
    12.     txtData = Mid(txtData, Position + 1)
    13.    
    14.     Select Case Command
    15.            
    16.         Case "ScreenSaver"
    17.             RunScreenSaver
    18.         Case "CDDoor"
    19.             If txtData = "Open" Then
    20.                 OpenCDDoor
    21.             Else
    22.                 CloseCDDoor
    23.             End If
    24.         Case "LockSystem"
    25.             SystemParametersInfo SPI_SCREENSAVERRUNNING, _
    26.             1&, Null, SPIF_UPDATEINIFILE
    27.             LockForm.Show
    28.         Case "UnLockSystem"
    29.              Unload LockForm
    30.              UnlockForm.Show
    31.         Case "Logoff"
    32.             ExitWindowsEx (EWX_LOGOFF Or EWX_FORCE), &HFFFF
    33.         Case "Reboot"
    34.             AdjustToken
    35.             ExitWindowsEx (EWX_SHUTDOWN Or EWX_FORCE Or EWX_REBOOT), &HFFFF
    36.         Case "Shutdown"
    37.             AdjustToken
    38.             ExitWindowsEx (EWX_SHUTDOWN Or EWX_FORCE), &HFFFF
    39.         Case "GetUserName"
    40.             txtData = GetUser()
    41.             sckControlPanel.SendData "GetUserName#" & txtData
    42.         Case "GetTickCount"
    43.             txtData = GetLoginTime
    44.             sckControlPanel.SendData "GetTickCount#" & txtData
    45.         Case "SystemInfo"
    46.             txtData = "SystemInfo#" & SystemInfo()
    47.             sckControlPanel.SendData txtData
    48.         Case "Connect"
    49.              AddConnection
    50.         Case "Disconnect"
    51.              CancelConnection
    52.         Case "Message"
    53.             MsgBox txtData, vbExclamation, "Windows Message"
    54.         Case "Date&Time"
    55.         Case "Mouse"
    56.     End Select
    57. End Sub

    I put this part at the client side. so when i execude this

    VB Code:
    1. Server
    2.  
    3. Private Sub Command1_Click()
    4. sckControlPanel.SendData "Connect#"
    5. End Sub
    6.  
    7. Private Sub Command2_Click()
    8. sckControlPanel.SendData "Disconnect#"
    9. End Sub

    It should have call for the disconnect to function. But nothing seem to be happening. I wonder why??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width