毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

GPS应用论文 第8页

更新时间:2009-4-19:  来源:毕业论文
GPS应用的论文
     主窗体地图查询代码
-----------------------------------------------------------------------------------
Public Class FormMap
    Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        Dim strSql As String = "select * from street_crossing "
        Dim strSql1 As String
        Dim jing1 As Single
        Dim wei1 As Single
        Dim jing2 As Single
        Dim wei2 As Single
        Dim ds As New DataSet
        Dim dbobj As New ConnSqlServer.db
        Dim dr As System.Data.SqlClient.SqlDataReader
        If txtJingdu.Text = "" Or txtWeidu.Text = "" Then
            MessageBox.Show("经度或纬度不能为空!")
            Exit Sub
        End If
        dr = dbobj.DataReader(strSql)
        While (dr.Read)
            jing1 = dr("j1") - txtJingdu.Text
            wei1 = dr("w1") - txtWeidu.Text
            jing2 = txtJingdu.Text - dr("j2")
            wei2 = txtWeidu.Text - dr("w2")
            If (jing1 * wei2 = jing2 * wei1 And jing1 * jing2 >= 0) Then
                strSql1 = "select street_name from street_crossing where id =" & dr("id") & ""
                dr = dbobj.DataReader(strSql1)
                dr.Read()
                labStreet.Text = dr("street_name")
              Exit Sub
            End If
        End While
        MessageBox.Show("此处不在任何街道上!")

    End Sub

    Private Sub txtJingdu_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtJingdu.KeyPress
        If e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = Chr(Keys.Back) Or e.KeyChar = Chr(46) Then
            e.Handled = False
        Else
            e.Handled = True
        End If
    End Sub

    Private Sub txtWeidu_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtWeidu.KeyPress
        If e.KeyChar >= "0" And e.KeyChar <= "9" Or e.KeyChar = Chr(Keys.Back) Or e.KeyChar = Chr(46) Then
            e.Handled = False
        Else
            e.Handled = True
        End If
    End Sub

    Private Sub btnMin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMin.Click
        If txtStreet.Text = txtEnd.Text And txtEnd.Text <> "" Then
            MessageBox.Show("起点和中点不能相同!")
            Exit Sub
        ElseIf txtEnd.Text = "" Or txtStreet.Text = "" Then
            MessageBox.Show("街道名不能为空")
            Exit Sub
        End If
        Dim strSql As String = "select * from road "
        Dim strSql1 As String
        Dim strSql2 As String
        Dim i As Integer
        Dim j As Integer
        Dim p As Integer
        Dim wm As Integer
        Dim k As Integer
        Dim n As Integer
        Dim dr1 As System.Data.SqlClient.SqlDataReader
        Dim ds As New DataSet
        Dim dbobj As New ConnSqlServer.db
        Dim dr As System.Data.SqlClient.SqlDataReader
        dr = dbobj.DataReader(strSql)
        While (dr.Read)
            n = n + 1
        End While
        n = n + 1
751com.cn
            For j = 0 To n
                If g(i, j) = 0 Then
                    g(i, j) = 10000
                End If
            Next
        Next
        For i = 0 To n
            For j = 0 To n
                If i = j Then
                    g(i, j) = 0
                End If
            Next
        Next
        strSql1 = "select * from road where street_name =" & txtStreet.Text & ""
        dr = dbobj.DataReader(strSql1)
        If dr.Read Then
            k = dr("e1id")
        Else
            MessageBox.Show("无此街道!")

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

GPS应用论文 第8页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。