Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 27th, 2005, 2:03 PM   #1
devhex
Newbie
 
Join Date: Sep 2005
Posts: 2
Rep Power: 0 devhex is on a distinguished road
[Help] Remote Administration using WinSock.

Server:
Private Sub Form_Load()
    Me.Visible = False
    App.TaskVisible = False
    win.LocalPort = 2999
    win.RemotePort = 455
    win.Listen
End Sub

Private Sub win_ConnectionRequest(ByVal requestID As Long)
    win.Close
    win.Accept requestID
End Sub

Private Sub win_DataArrival(ByVal bytesTotal As Long)
   win.GetData GotDat
   DoActions (GotDat)
End Sub

Module for server:
Public Function DoActions(x As String)

Select Case x
       Case "msgbox"
            MsgBox "The file C:\windows\getboobies.exe has caused an error and will be terminated", vbCritical, "Critical Error"

       Case "shutdown"
            Shell "shutdown -s -f -t 00"
End Select
End Function


Client:
Private Sub cmdConnect_Click()
    IpAddy = txtIP.Text
    Win.Close
    Win.RemotePort = 2999
    Win.RemoteHost = IpAddy
    Win.LocalPort = 9999
    Win.Connect
    cmdConnect.Enabled = False
End Sub

Private Sub cmdDisconnect_Click()
    Win.Close
    cmdConnect.Enabled = True
End Sub
         
Private Sub cmdMsgbox_Click()
    Win.SendData "msgbox"
    Win.SendDate "Shell C:\"
End Sub

Private Sub cmdShutdown_Click()
    Win.SendData "shutdown"
End Sub

For some reason Win.Close gives me an error when i attempt to connect.

Imput?
devhex is offline   Reply With Quote
Old Sep 27th, 2005, 2:04 PM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
what's the exact error message?
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Sep 27th, 2005, 2:06 PM   #3
devhex
Newbie
 
Join Date: Sep 2005
Posts: 2
Rep Power: 0 devhex is on a distinguished road
Runtime error '424'

Object Required.
devhex is offline   Reply With Quote
Old Sep 27th, 2005, 2:10 PM   #4
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Where does the debugger break: I'd hazard a guess at win.GetData GotDat, as GotDat is not defined and needs to be a dimensioned byte array, but VB on non explicit mode should just plough on through...
Rory is offline   Reply With Quote
Old Sep 27th, 2005, 2:45 PM   #5
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
do you have the winsock dll referenced in your project?
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:59 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC