Himpunan Mahasiswa Sistem Informasi Universitas Mercubuana

    detect url and search form www data in vb

    Super Administrator
    Super Administrator

    Male Jumlah posting : 82
    Age : 28
    Fakultas : Fasilkom
    Jurusan : sistem informasi
    Interest in : Visual Basic,xna,C#
    Registration date : 07.01.09

    detect url and search form www data in vb

    Post by Alen1.1 on Mon Dec 28, 2009 3:53 am

    Unless you are in control of the pages the client can view, that is going to
    be difficult because you won't know what the name of the search box is.
    You might just want to log wherever they navigate to, and use that to help
    determine which pages use what names for their parameters.
    Here is s short example of how you can monitor IE. It uses a form that
    reports the data as it happens, but you don't need to use a form, a class
    would do, or, you don't need to show the form, you could just log the
    data behind the scenes.
    To see the example, start a new project and add a reference to
    Microsoft Internet Controls. Then give the form a Textbox and set its
    MultiLine property to True, and ScrollBars property to 3 (Both).
    Paste in the code below and run the program. When IE shows up
    use it to navigate around, (Do a few searches) and watch the output in
    the form. It is a bit interesting to navigate to My Computer, or the
    Recycle bin, or other such system places...
    (Keep in mind this is only one way to grab a reference to a running instance.
    There are others....)
    Option Explicit
    ' Add reference to Microsoft Internet Controls for:
    Private WithEvents IE As InternetExplorer
    Private Sub Form_Load()
    Dim newEx As New InternetExplorer
    Text1.Text = ""
    newEx.Visible = True
    newEx.Navigate2 "about:blank"
    Set IE = newEx
    End Sub
    Private Sub Form_Resize()
    Text1.Move 0, 0, ScaleWidth, ScaleHeight
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
    On Error Resume Next
    Set IE = Nothing
    End Sub
    Private Sub IE_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As
    Variant, Headers As Variant, Cancel As Boolean)
    Post "Navigate:", URL, "Flags:", Flags, "Name:", TargetFrameName, "Data:", StrConv(PostData, vbUnicode), "Header:", Headers
    End Sub
    Private Sub IE_OnQuit()
    Unload Me
    End Sub
    Private Sub Post(ParamArray Data())
    Dim i
    If Len(Text1.Text) > 28000 Then
    i = InStr(2000, Text1.Text, vbCrLf & vbCrLf & vbCrLf)
    Text1.Text = Mid$(Text1.Text, i + 8)
    Text1.SelStart = Len(Text1.Text)
    End If
    For i = 0 To UBound(Data) Step 2
    Text1.SelText = Data(i) & vbCrLf
    Text1.SelText = Data(i + 1)
    Text1.SelText = vbCrLf & vbCrLf
    Text1.SelText = vbCrLf & vbCrLf
    End Sub

    janganlah selalu Inilah ayah saya,inilah paman saya,inilah teman saya...

    Tapi Inilah saya dengan segala kelebihan dan banyak kekurangan.

      Waktu sekarang Wed Jan 16, 2019 8:50 pm