469,129 Members | 1,743 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,129 developers. It's quick & easy.

Vb6 Dailup connection problem

4
This code works with all types of internet connections,nor dail up i wonder why ?!!!

Expand|Select|Wrap|Line Numbers
  1. On Error Resume Next
  2.  
  3. If Winsock1.State <> sckConnected Then
  4. 'Gets length of chat URL
  5.  
  6. meh = Len(txtsite.Text)
  7. bleh = Hex(Val(meh))
  8.  
  9. If Len(bleh) = "3" Then
  10. bleh = "0" & bleh
  11. End If
  12.  
  13. If Len(bleh) = "4" Then
  14. lft = Left(bleh, 2)
  15. rgt = Right(bleh, Len(bleh) - 2)
  16.  
  17. bleh = lft & " " & rgt
  18. End If
  19.  
  20.  
  21. wlen2 = bleh
  22.  
  23. Pos = 1
  24.  
  25.  
  26.  
  27.  
  28.       While Pos <= Len(wlen2)
  29.           CurChar = Mid(wlen2, Pos, 2)
  30.  
  31.           If wlen2 = "" Then
  32.               wlen = Chr(CLng("&H" & CurChar))
  33.           Else
  34.               wlen = wlen & Chr(CLng("&H" & CurChar))
  35.           End If
  36.  
  37.           Pos = Pos + 3
  38.       Wend
  39.  
  40.  
  41.  
  42.  
  43. 'Does SITEID
  44.  
  45. meh = txtid.Text
  46. bleh = Hex(Val(meh))
  47.  
  48. If Len(bleh) = "3" Then
  49. bleh = "0" & bleh
  50. End If
  51.  
  52. lft = Left(bleh, 2)
  53. rgt = Right(bleh, Len(bleh) - 2)
  54.  
  55. bleh = lft & " " & rgt
  56.  
  57.  
  58. siteid = bleh
  59. resetid.Text = bleh
  60.  
  61.  
  62. Pos = 1
  63.  
  64.  
  65.  
  66.  
  67.       While Pos <= Len(siteid)
  68.           CurChar = Mid(siteid, Pos, 2)
  69.  
  70.           If siteid = "" Then
  71.               siteid2 = Chr(CLng("&H" & CurChar))
  72.           Else
  73.               siteid2 = siteid2 & Chr(CLng("&H" & CurChar))
  74.           End If
  75.  
  76.           Pos = Pos + 3
  77.       Wend
  78.  
  79.  
  80.  
  81.  
  82. 'Does nickname
  83. bleh = ""
  84.  
  85. meh = Len(txtnick.Text)
  86. bleh = Hex(Val(meh))
  87.  
  88. If Len(bleh) = "3" Then
  89. bleh = "0" & bleh
  90. End If
  91.  
  92. If Len(bleh) >= "4" Then
  93. lft = Left(bleh, 2)
  94. rgt = Right(bleh, Len(bleh) - 2)
  95.  
  96. bleh = lft & " " & rgt
  97. End If
  98.  
  99.  
  100. nick = bleh
  101.  
  102. Pos = 1
  103.  
  104.  
  105.  
  106.  
  107.       While Pos <= Len(nick)
  108.           CurChar = Mid(nick, Pos, 2)
  109.  
  110.           If nick = "" Then
  111.               nlen = Chr(CLng("&H" & CurChar))
  112.           Else
  113.               nlen = nlen & Chr(CLng("&H" & CurChar))
  114.           End If
  115.  
  116.           Pos = Pos + 3
  117.       Wend
  118.  
  119.  
  120.  
  121.  
  122.  
  123. SckClient.RemoteHost = txtport.Text
  124. SckClient.RemotePort = "8396"
  125. Command1.Enabled = False
  126.  
  127. SckClient.Connect
  128. Else
  129. MsgBox "Already connected!", vbCritical, "Connection Tester"
  130. End If


Could anyone help please !!!!!!!! :confused:
Apr 25 '06 #1
0 1327

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Mark | last post: by
35 posts views Thread by Eric Sabine | last post: by
16 posts views Thread by crbd98 | last post: by
20 posts views Thread by fniles | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.