Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Winsock Control
#1
Hey, I need help (again) with the Winsock Control (v 6.0 , and VB 2010). First, it seems that VB does not recognize state method, like:
Code:
If sock.State = sckListening Then
, second I'd like to know how to execute a file or a command in the cmd (no, i'm not trying to make a RAT app).

Thank you <!-- sBig Grin --><img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt="Big Grin" title="Very Happy" /><!-- sBig Grin -->
#2
Hey Covert2Sting,

Thanks again for posting on BP Forums!

First of all, I am not really sure why VB is not recognizing the State command for Winsocks, I mean.. It is a standard command. That is really strange.

As for opening applications or opening a command prompt command, here is the code
Code:
'To open applications
Process.start("APPLICATION PATH.exe")

Code:
'To send a CMD command via a CMD window
Dim psi As Object = New ProcessStartInfo
psi.FileName = "cmd.exe"
Process.Start(psi) 'Open a new CMD Window
SendKeys.Send("COMMAND HERE" & "{enter}") 'Type in a command (such as 'help' or 'dir') and press enter

Hope this helps a bit, sorry about not knowing the reasons for the unrecognized State property.
My Blog | My Setup | My Videos | Have a wonderful day.
#3
I meant remotely execute an application.
#4
Ah, via the Winsock control... I have no idea how to do this, sorry <!-- sTongue --><img src="{SMILIES_PATH}/icon_razz.gif" alt="Tongue" title="Razz" /><!-- sTongue -->
My Blog | My Setup | My Videos | Have a wonderful day.
#5
Ok, one more thing, do you know how to create an array of winsock control? In VB 6 it was easy, but I can't figure it out in VB 2010...
#6
Well, I have never really worked with the Winsock Control, so I have no idea if this would work, but you can give it a shot!
Code:
Dim wList As List(Of Winsock)
wList.Add(Winsock1)
wList.Add(Winsock2)
'...Etc
My Blog | My Setup | My Videos | Have a wonderful day.
#7
Seriously, are you God? If not, how do you always have the answer?! Thank you!!! After googling for hours I couldn't find how to do it!

Edit: Here:
wList.Add(Winsock1)

Winsock1 is the name of the control? As a string?

Edit2: I forgot to say that I have to create another winsock control, not just add them to the list, how can I do that?
#8
Well, I am not God. But thanks for the compliments!!

Winsock1 is the name of the control, but it is the control itself. If you would like to actually create a new Winsock control, and add it to the list, do something like this
Code:
Dim WS1 As New Winsock
wList.Add(WS1)

Hopefully this helps!
My Blog | My Setup | My Videos | Have a wonderful day.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Custom tab control help and making controls Derek275 4 21,172 11-16-2012, 09:51 AM
Last Post: Snake_eyes
  Help Formatting Credit Number in Textbox Control kismetgerald 11 37,760 08-30-2012, 08:19 PM
Last Post: brandonio21
  Custom Tab Control xolara 5 20,386 04-24-2011, 07:12 PM
Last Post: xolara

Forum Jump:


Users browsing this thread: 1 Guest(s)