PDA

View Full Version : 2 small questions bout VB code


John-
09-12-2003, 02:00 PM
first question is how do i give a program proxy/socks support?

if my program tries to connect to something like


winsock1.remotehost = cracksmokers.com
winsock1.remotepost = 50000000000000
winsock1.connect

could i put this before that

winsock1.remotehost = text1
winsock1.remoteport = text2
winsock1.connect

winsock1.remotehost = cracksmokers.com
winsock1.remotepost = 50000000000000
winsock1.connect


if i did this would it connect to whatever ip i have in text1 on whatever port i have in text2 then through this computer then connect to my example site cracksmokers.com?

if not what do i have to do also sorry if that question doesnt make sense or is n00bish but i am a n00b.

2nd question

when i press a button in my program it does a few things but before it moves on to the next thing it waits for a response for example

WaitForResponse ("hello")

but what if i wanted it to move onto the next task if another response happens instead for example if the response is goodbye.

i realise i would have to put
WaitForResponse ("goodbye")

but what if i wanted to wait for either responses not both just 1 of the 2 how would i put the code?

would it be something like this

WaitForResponse ("goodbye") or ("hello")

i was going to put
WaitForResponse ("goodbye") & ("hello")
but then i realised this would wait for both responses not just the one.

thanks i hope my questions make sense when you read them.
john

baloney_mahoney
09-12-2003, 06:56 PM
Originally posted by john123456
first question is how do i give a program proxy/socks support?

if my program tries to connect to something like


winsock1.remotehost = cracksmokers.com
winsock1.remotepost = 50000000000000
winsock1.connect

could i put this before that

winsock1.remotehost = text1
winsock1.remoteport = text2
winsock1.connect

winsock1.remotehost = cracksmokers.com
winsock1.remotepost = 50000000000000
winsock1.connect


if i did this would it connect to whatever ip i have in text1 on whatever port i have in text2 then through this computer then connect to my example site cracksmokers.com?

if not what do i have to do also sorry if that question doesnt make sense or is n00bish but i am a n00b.

2nd question

when i press a button in my program it does a few things but before it moves on to the next thing it waits for a response for example

WaitForResponse ("hello")

but what if i wanted it to move onto the next task if another response happens instead for example if the response is goodbye.

i realise i would have to put
WaitForResponse ("goodbye")

but what if i wanted to wait for either responses not both just 1 of the 2 how would i put the code?

would it be something like this

WaitForResponse ("goodbye") or ("hello")

i was going to put
WaitForResponse ("goodbye") & ("hello")
but then i realised this would wait for both responses not just the one.

thanks i hope my questions make sense when you read them.
john

First of all, you lied! You said two small questions.

Second: there is no such thing as remoteport=50000000000000.

Third:

winsock1.remotehost = text1
winsock1.remoteport = text2
winsock1.connect

will do just fine as long as text1 and text2 have valid data.


I'm not sure what WaitForResponse(.......) is but this is what I would do.....

Sub MyLittleSubroutine(.........)

winsock1.remotehost = text1
winsock1.remoteport = text2
winsock1.connect
'
' Do whatever you want to do
'
End Sub

Private Sub winsock1_DataArrival(.............)
Dim s1 as string

winsock1.GetData s1, vbString

Select Case s1
Case "hello"
do something for hello
Case "goodbye"
do something for goodbye
End Select

End Sub

John-
09-12-2003, 09:13 PM
baloney_mahoney i dont wanna disrespect you,
but i was using 5000000000
as an example port if you couldnt see that then you
shouldnt be answering my question.

baloney_mahoney
09-12-2003, 11:41 PM
I knew you were not serious and neither was I about the port number

nscopex
09-16-2003, 09:00 PM
Mahoney, you didnt answer anything. Why did you even try?