-
Convert this to .net
Could someone convert this code vb6 to .net code for me
Public Function returnInfoArray(strHTMLData) As Variant
On Error Resume Next
Dim iArray(1 To 3) As String
Dim sString As String
Dim dPos As Long
Dim dPos2 As Long
sString = "<title>" & vbCrLf & "ebay item"
dPos = InStr(1, LCase(strHTMLData), sString) + Len(sString)
If dPos > Len(sString) Then
sString = " - "
dPos = InStr(dPos, LCase(strHTMLData), sString) + Len(sString)
If dPos > Len(sString) Then
sString = "</title>"
dPos2 = InStr(dPos, LCase(strHTMLData), sString)
iArray(1) = stripLineBreak(Mid(strHTMLData, dPos, dPos2 - dPos))
Else
iArray(1) = "(Info not found)"
End If
Else
iArray(1) = "(Info not found)"
End If
sString = "# of bids"
dPos = InStr(1, LCase(strHTMLData), sString) + Len(sString)
If dPos > Len(sString) Then
sString = "<td width=""45%""><b>"
dPos = InStr(dPos, LCase(strHTMLData), sString) + Len(sString)
If dPos > Len(sString) Then
sString = "</b><font size=""2"">"
dPos2 = InStr(dPos, LCase(strHTMLData), sString)
iArray(2) = stripLineBreak(Mid(strHTMLData, dPos, dPos2 - dPos))
Else
iArray(2) = ""
End If
Else
iArray(2) = ""
End If
sString = "font size=""2"">" & vbCrLf & "currently" & vbCrLf & "</font>"
dPos = InStr(1, LCase(strHTMLData), sString) + Len(sString)
If dPos > Len(sString) Then
sString = "<td width=""31%""><b>"
dPos = InStr(dPos, LCase(strHTMLData), sString) + Len(sString)
If dPos > Len(sString) Then
sString = "</b>"
dPos2 = InStr(dPos, LCase(strHTMLData), sString)
iArray(3) = stripLineBreak(Mid(strHTMLData, dPos, dPos2 - dPos))
Else
iArray(3) = ""
End If
Else
iArray(3) = ""
End If
returnInfoArray = iArray
End Function
Thanks a lot !
-
You can do it easily yourself. Save it in a VB6 project, and then open that project in VB.NET. It will convert everything for you.
But i don't see anything weird in there. That could will run as is in VB.NET. Sure you could tweak it to make it better/faster, but it's fine the way it is.
-
what is striplinebreak equal to in vb.net??? and how would i convert the lines with the striplinebreak to be equevalent in .net??
-
-
stripLineBreak looks like a custom function. Sure you have all the original code there.