01-14-2012, 12:40 AM
Maaf om2 klo threadnya slah 
ane cuma tanya ini ad yg slah.
terus cara beneri codingnya gmn y ?
Salahnya di sini om.
![[Image: Untitled-32.png]](http://i1133.photobucket.com/albums/m599/tsdt7wetew/Untitled-32.png)

ane cuma tanya ini ad yg slah.
terus cara beneri codingnya gmn y ?

PHP Code:
Imports System.Xml
Imports System.IO
Public Class Form1
Dim sck As New clsHTTP
Private Delegate Sub str(ByVal x As String)
Dim mStep As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
With sck
.Reset()
.CookieFile = Application.StartupPath & "\cookies.xml"
.Method = clsHTTP.postMethodEnum.POST
.PostType = clsHTTP.PostTypeEnum.URLENCODED
.Url = "http://www.fileserve.com/login.php"
.Timeout = 20000
.AddParam("loginUserName", txtUser.Text)
.AddParam("loginUserPassword", txtPass.Text)
.AddParam("autoLogin", "on")
.AddParam("loginFormSubmit", "Login")
Debug.WriteLine("Connectng")
mStep = 1
.ExecuteAsync()
End With
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AddHandler sck.Failed, AddressOf sckFailed
AddHandler sck.Complete, AddressOf sckComplete
End Sub
Private Sub sckComplete(ByVal sData As String)
If Me.InvokeRequired Then
Dim d As New str(AddressOf sckComplete)
Me.BeginInvoke(d, New Object() {sData})
Else
Try
Debug.Print(sData)
If mStep = 1 Then
If sData.Contains(">Dashboard<") Then
Dim tmpType As String = ParseMid(sData, "<h5>Account type", "</td>")
If tmpType.Contains("<h3>Premium") Then
lblAccountType.Text = "Premium"
Else
lblAccountType.Text = "Free User"
End If
Dim tmpEarn As String = ParseMid(sData, "<h5>Total Earnings", "</h3>")
lblEarning.Text = "$" & ParseMid(tmpEarn, "normal;"">", "</span>")
Dim fU As String = ParseMid(sData, "<h5>Files uploaded", "</h3>")
lblFU.Text = ParseMid(fU, "<h3>", "<span>")
Dim dL As String = ParseMid(sData, "<h5>Download speed", "</h3>")
lblDLS.Text = ParseMid(dL, "<h3>", "<span>") & "KB/s"
Dim storage As String = ParseMid(sData, "<h5><span>Storage", "Byte</span>")
Dim gb As String = ParseMid(sData, "<span> Byte</span>", "<span> GB</span>")
lblStorage.Text = Replace(ParseMid(storage, "<h3>", "<span>"), " ", "") & "Bytes" & Replace(ParseMid(gb, "<span> Byte</span>", "<span> GB</span>"), " ", "") & "/500GB"
Else
MessageBox.Show("Login Failed For Fileserve", "checker")
End If
End If
Catch ex As Exception
End Try
End If
End Sub
Public Function ParseMid(ByVal strData As String, ByVal strStart As String, ByVal strStop As String, Optional ByVal mReverse As Boolean = False) As String
Dim iStart As Integer = 0
Dim iStop As Integer = 0
Try
If mReverse Then
iStart = strData.LastIndexOf(strStart)
Else
iStart = strData.IndexOf(strStart, 0)
End If
If iStart <= 0 Then Return ""
iStop = strData.IndexOf(strStop, iStart + strStart.Length)
If iStop = 0 Then
Return strData.Substring(iStart + strStart.Length)
Else
Return strData.Substring(iStart + strStart.Length, iStop - iStart - strStart.Length)
End If
Catch ex As Exception
Return ""
End Try
End Function
Private Sub sckFailed(ByVal mErr As String)
If Me.InvokeRequired Then
Dim d As New str(AddressOf sckFailed)
Me.BeginInvoke(d, New Object() {mErr})
Else
End If
End Sub
End Class
Salahnya di sini om.
![[Image: Untitled-32.png]](http://i1133.photobucket.com/albums/m599/tsdt7wetew/Untitled-32.png)
![[Image: animasi_xcode1-1.gif]](http://i1133.photobucket.com/albums/m599/tsdt7wetew/TOP/animasi_xcode1-1.gif)



