I am making a game client, others use visual basic 6 to do this, the code works for them, but does not for me(I use VB 2005 .NET) This is a High Score retriver, the website uses smart parsing so it is difficult to parse the website code to find the numbers.

If you know both languages, please help in this, here is the code:

VB Code:
  1. Function GetLvl(ByVal Username As String, ByVal Skill As String, ByVal HTML As String) As String
  2.         Dim pos As Integer, tmpInet As Object
  3.         If HTML = "" Then
  4.             tmpInet = CreateObject("InetCtls.Inet")
  5.             HTML = tmpInet.OpenURL("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=" & Username)
  6.             tmpInet.Cancel()
  7.         End If
  8.         pos = InStr(1, HTML, ">" & Skill & "<", 1)
  9.         If InStr(pos, HTML, "t""", 1) > pos + 40 Then Exit Function
  10.         pos = InStr(InStr(pos, HTML, "t""", 1) + 1, HTML, "t""", 1) + 3
  11.         GetLvl = Mid(HTML, pos, InStr(pos, HTML, "<") - pos)
  12.     End Function

In the debugger, It has an error "Argument 'Start" must be greater than zero." So when I add "if pos = 0 then pos = 1" that skips that but comes upon another: "Argument 'Lenth' must be greater or equil to zero."

As of again please help.