HELP me fix the codes please?

Discussion in 'Programming' started by theemerchant, Jul 7, 2010.

  1. #1
    Hi,

    Can anyone please help me on this?

    The server is supposed to see which computers are online and which are not.
    if the workstation are not online the computer should not be seen on the server's list but if it open again the computer name should appear on the list.

    This is the codes I used

    Private Sub btnShutdown_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShutdown.Click
    On Error Resume Next
    If MessageBox.Show("Are you sure you wish to shutdown " & Computer & "?", "Confirm shutdown", _
    MessageBoxButtons.YesNo, MessageBoxIcon.Question) = System.Windows.Forms.DialogResult.Yes Then
    strOperation = "SHUTDOWN"
    compIPaddress = ""
    compIPaddress = System.Net.Dns.GetHostByName(Computer).AddressList(0).ToString()
    If Trim(compIPaddress) = "" Then
    MsgBox("Please select a computer!!!", MsgBoxStyle.Information, "Computer???")
    Else
    trSendMessage = New Thread(AddressOf SendMessage)
    trSendMessage.Start()
    MessageBox.Show("Client " & Computer & " has been shutdown.")
    TVComputers.Nodes.Remove(TVComputers.SelectedNode)
    End If
    End If
    End Sub


    the shutdown button is working, the problem is, when i open again the computer that is being shutdown on the workstation, it is not appearing on the server's list. what's wrong with the code and what should I do?

    Thanks a lot in advance.
     
    theemerchant, Jul 7, 2010 IP