Monday, 26 March 2012

ip tracer and map


IP Tracer? What is the benefit?

Using the IP tracer or IP lookup tool on IP-Adress.com will allow you to trace the origin of an IP address back to the original source.
The IP locator tool helps to identify the IP address in question by searching for it with our online-based IP tracing tool.
Our IP lookup can help trace an IP address anywhere in the world and provide further details for your query.
No matter what you call it, an IP tracer, IP locator, and IP lookup are referencing the same tool like the one we provide here on our website. The tool is easy to use and has a very high accuracy rate for tracing an IP address online, no matter the location you are searching for.

  Get Your  :-  Source Code

Sunday, 11 March 2012

Add a Google Map to a VB Desktop Application




Code:  Form 1
The form 1 class starts out with the default class declaration. An import statement was added to pull in the System.Text library; this is required to support the use of string builders within the application.
Imports System.Text

Public Class Form1
Following the class declaration, the next bit of code in the class is used to handle the button click event that requests a map of a physical address from Google Maps; that code is as follows: 
''' <summary>
''' Map a physical address
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub btnMapIt_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnMapIt.Click

    Try
        Dim street As String = String.Empty
        Dim city As String = String.Empty
        Dim state As String = String.Empty
        Dim zip As String = String.Empty
        Dim queryAddress As New StringBuilder()
        queryAddress.Append("http://maps.google.com/maps?q=")

        ' build street part of query string
        If txtStreet.Text <> String.Empty Then
            street = txtStreet.Text.Replace(" ""+")
            queryAddress.Append(street + "," & "+")
        End If

        ' build city part of query string
        If txtCity.Text <> String.Empty Then
            city = txtCity.Text.Replace(" ""+")
            queryAddress.Append(city + "," & "+")
        End If

        ' build state part of query string
        If txtState.Text <> String.Empty Then
            state = txtState.Text.Replace(" ""+")
            queryAddress.Append(state + "," & "+")
        End If

        ' build zip code part of query string
        If txtZipCode.Text <> String.Empty Then
            zip = txtZipCode.Text.ToString()
            queryAddress.Append(zip)
        End If

        ' pass the url with the query string to web browser control
        webBrowser1.Navigate(queryAddress.ToString())

    Catch ex As Exception

        MessageBox.Show(ex.Message.ToString(), "Unable to Retrieve Map")

    End Try

End Sub 
A quick examination of this code reveals that the contents of the text boxes used to define the physical address are captured from the form and used to populate variables local to the event handler. A string builder is used to build the URL and query string. 
Once the string builder is initialized, the first part of the URL is appended to it. As each additional section of the address is conditioned for use in the query string, it too is appended to the query string. Once the string is defined, it is passed to the web browser control as its navigate URL. At that point, the web browser will display the address if it can be found or will summon Goggle Maps with optional selections used to narrow down to a single address.
The next bit of code in the application performs a similar function with Latitudes and Longitudes; the click event handler for the button is used to evoke the map based upon the user supplied lat/long values. That code is as follows: 
''' <summary>
''' Map a location by latitude and longitude
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub btnMapLatLong_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles btnMapLatLong.Click

    If txtLat.Text = String.Empty Or txtLong.Text = String.Empty Then
        MessageBox.Show("Supply a latitude and longitude value.""Missing Data")
    End If

    Try
        Dim lat As String = String.Empty
        Dim lon As String = String.Empty
        Dim queryAddress As New StringBuilder()
        queryAddress.Append("http://maps.google.com/maps?q=")

        ' build latitude part of query string
        If txtLat.Text <> String.Empty Then
            lat = txtLat.Text
            queryAddress.Append(lat + "%2C")
        End If

        ' build longitude part of query string
        If txtLong.Text <> String.Empty Then
            lon = txtLong.Text
            queryAddress.Append(lon)
        End If

        webBrowser1.Navigate(queryAddress.ToString())

    Catch ex As Exception

        MessageBox.Show(ex.Message.ToString(), "Error")

    End Try

End Sub 


A simple calculator


please help me to finish this calc.
this calc.'s work, but when i do this < 1 + 1 * 2 > or i should say when using other operations it stops working. here's my code:
Public Class Form1
Dim num1, num2 As Integer
Dim opr As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn0.Click
lbl1.Text = lbl1.Text & "0"
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
lbl1.Text = lbl1.Text & "1"
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn2.Click
lbl1.Text = lbl1.Text & "2"
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn3.Click
lbl1.Text = lbl1.Text & "3"
End Sub

Private Sub btn4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn4.Click
lbl1.Text = lbl1.Text & "4"
End Sub

Private Sub btn5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn5.Click
lbl1.Text = lbl1.Text & "5"
End Sub

Private Sub btn6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn6.Click
lbl1.Text = lbl1.Text & "6"
End Sub

Private Sub btn7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn7.Click
lbl1.Text = lbl1.Text & "7"
End Sub

Private Sub btn8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn8.Click
lbl1.Text = lbl1.Text & "8"
End Sub

Private Sub btn9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn9.Click
lbl1.Text = lbl1.Text & "9"
End Sub

Private Sub btnclear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclear.Click
lbl1.Text = ""
End Sub

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
num1 = Val(lbl1.Text)
opr = "+"
lbl1.Text = ""
End Sub

Private Sub btnsubtract_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsubtract.Click
num1 = Val(lbl1.Text)
opr = "-"
lbl1.Text = ""
End Sub

Private Sub btnmultiply_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmultiply.Click
num1 = Val(lbl1.Text)
opr = "*"
lbl1.Text = ""
End Sub

Private Sub btndivide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndivide.Click
num1 = Val(lbl1.Text)
opr = "/"
lbl1.Text = ""
End Sub

Private Sub btnequals_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnequals.Click
num2 = Val(lbl1.Text)
Select Case opr
Case "+" : lbl1.Text = num1 + num2
Case "-" : lbl1.Text = num1 - num2
Case "*" : lbl1.Text = num1 * num2
Case "/" : lbl1.Text = num1 / num2
End Select

End Sub

Private Sub lbl1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbl1.Click
lbl1.Text = ""
End Sub
End Class

auto complete combobox control

Option Strict On
Option Explicit On

Imports System.Windows.Forms
Public Class AutoCompleteCombo
Inherits ComboBox
Private mResetOnClear As Boolean = False

Protected Overrides Sub RefreshItem(ByVal index As Integer)
MyBase.RefreshItem(index)
End Sub

Protected Overrides Sub SetItemsCore(ByVal items As System.Collections.IList)
MyBase.SetItemsCore(items)
End Sub

Public Shadows Sub KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
Dim intIndex As Integer
Dim strEntry As String

If Char.IsControl(e.KeyChar) Then
If MyBase.SelectionStart <= 1 Then If mResetOnClear Then MyBase.SelectedIndex = 0 MyBase.SelectAll() Else MyBase.Text = String.Empty MyBase.SelectedIndex = -1 End If e.Handled = True Exit Sub End If If MyBase.SelectionLength = 0 Then strEntry = MyBase.Text.Substring(0, MyBase.Text.Length - 1) Else strEntry = MyBase.Text.Substring(0, MyBase.SelectionStart - 1) End If ElseIf (Not Char.IsLetterOrDigit(e.KeyChar)) And (Not Char.IsWhiteSpace(e.KeyChar)) Then '< 32 Or KeyAscii > 127 Then
Exit Sub
Else
If MyBase.SelectionLength = 0 Then
strEntry = UCase(MyBase.Text & e.KeyChar)
Else
strEntry = MyBase.Text.Substring(0, MyBase.SelectionStart) & e.KeyChar
End If
End If

intIndex = MyBase.FindString(strEntry)

If intIndex <> -1 Then
MyBase.SelectedIndex = intIndex
MyBase.SelectionStart = strEntry.Length
MyBase.SelectionLength = MyBase.Text.Length - MyBase.SelectionStart
End If
e.Handled = True
Exit Sub
End Sub

Public Property ResetOnClear() As Boolean
Get
Return mResetOnClear
End Get
Set(ByVal Value As Boolean)
mResetOnClear = Value
End Set
End Property
End Class

Your ads