Har lavet lidt om i det.
Nyeste kode
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Declare Function InternetOpen Lib "wininet" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Integer, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Integer) As Integer
Private Declare Function InternetOpenUrl Lib "wininet" Alias "InternetOpenUrlA" (ByVal hInternetSession As Integer, ByVal lpszUrl As String, ByVal lpszHeaders As String, ByVal dwHeadersLength As Integer, ByVal dwFlags As Integer, ByVal dwContext As Integer) As Integer
Private Declare Function InternetReadFile Lib "wininet" (ByVal hFile As Integer, ByVal sBuffer As String, ByVal lNumBytesToRead As Integer, ByVal lNumberOfBytesRead As Integer) As Short
Private Declare Function InternetCloseHandle Lib "wininet" (ByVal hInet As Integer) As Short
Dim Cancel_Download As Integer
Function DownloadString(ByVal UrlFile As String) As String
Dim UrlInternetOpen As Integer
Dim UrlInternetOpenUrl As Integer
Dim UrlBuffer As New VB6.FixedLengthString(2048)
Dim UrlBytes As Integer
Dim UrlComplete As String
Cancel_Download = 0
UrlInternetOpen = InternetOpen("Download String", 1, vbNullString, vbNullString, 0)
UrlInternetOpenUrl = InternetOpenUrl(UrlInternetOpen, UrlFile, vbNullString, 0, &H80000000, 0)
Do
InternetReadFile(UrlInternetOpenUrl, UrlBuffer, Len(UrlBuffer), UrlBytes)
'UPGRADE_ISSUE: The preceding line couldn't be parsed. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="82EBB1AE-1FCB-4FEF-9E6C-8736A316F8A7"'
If UrlBytes = 0 Or Cancel_Download = 1 Then Exit Do 'Cancel_Download
UrlComplete = UrlComplete & Left(UrlBuffer.Value, UrlBytes)
DownloadBytes(Len(UrlComplete)) 'Function DownloadBytes
DoEvents()
'UPGRADE_ISSUE: The preceding line couldn't be parsed. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="82EBB1AE-1FCB-4FEF-9E6C-8736A316F8A7"'
Loop
InternetCloseHandle(UrlInternetOpenUrl)
InternetCloseHandle(UrlInternetOpen)
DownloadString = UrlComplete
End Function
Function CancelDownload() As Object
Cancel_Download = 1
End Function
Function DownloadBytes(ByVal Bytes As Integer) As Object
Dim Me As Object
'UPGRADE_WARNING: Couldn't resolve default property of object Me.Caption. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Me.caption = "Download: " & Bytes & " Bytes"
End Function
Private Sub Command1_Click()
Call CancelDownload()
End Sub
Private Sub Command2_Click()
Dim RichTextBox1 As Object
'UPGRADE_WARNING: Couldn't resolve default property of object RichTextBox1.Text. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
RichTextBox1.Text = DownloadString("
http://www.eksperten.dk/spm/487256")
End Sub
End Class
Nyeste fejl
Error 1 Value of type 'Microsoft.VisualBasic.Compatibility.VB6.FixedLengthString' cannot be converted to 'String'. H:\C4 Clan\C4-Clan\Form2.vb 28 50 C4-Clan
Error 2 'Public Property Left() As Integer' has no parameters and its return type cannot be indexed. H:\C4 Clan\C4-Clan\Form2.vb 31 41 C4-Clan
Error 3 Name 'DoEvents' is not declared. H:\C4 Clan\C4-Clan\Form2.vb 33 13 C4-Clan
Error 4 Keyword is not valid as an identifier. H:\C4 Clan\C4-Clan\Form2.vb 47 7 C4-Clan
Error 5 'caption' is not a member of 'C4_Clan.Form2'. H:\C4 Clan\C4-Clan\Form2.vb 49 9 C4-Clan
Warning 6 Function 'CancelDownload' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. H:\C4 Clan\C4-Clan\Form2.vb 44 5 C4-Clan
Warning 7 Variable 'RichTextBox1' is used before it has been assigned a value. A null reference exception could result at runtime. H:\C4 Clan\C4-Clan\Form2.vb 62 9 C4-Clan