打印本文 打印本文 关闭窗口 关闭窗口
VB.NET中的组件开发
作者:武汉SEO闵涛  文章来源:敏韬网  点击数5571  更新时间:2009/4/23 19:01:27  文章录入:mintao  责任编辑:mintao
 As String = System.BitConverter.ToString(mdByte)
        Dim mdString As String = (New ASCIIEncoding).GetString(mdByte)
        Return mdString

    End Function

    Public Function validate()Function validate() As Boolean

        ''''连接到Users表

        Dim myConnection As New SqlConnection("server=localhost;database=TEST;Trusted_Connection=yes;user id=sa;password=;")
        Dim selectAdapter As New SqlDataAdapter("select * from Users where UserName=''''" + username + "''''" + "and Password=''''" + convertMD5(userpwd) + "''''", myConnection)
        Dim ds As New DataSet
        Try
            selectAdapter.Fill(ds, "Users")
            If (ds.Tables(0).Rows.Count > 0) Then
                Return True
            Else
                Return False
            End If
        Catch ep As SqlException
            MsgBox("连接数据库出错")
        Catch pp As Exception
            MsgBox("Oh,发生了不可预料的事情在你身边,你死定了。退出吧。")
        End Try
    End Function
#Region " 组件设计器生成的代码 "

    Public Sub New()Sub New(ByVal Container As System.ComponentModel.IContainer)
        MyClass.New()

        ''''Windows.Forms 类撰写设计器支持所必需的
        Container.Add(Me)
    End Sub

    Public Sub New()Sub New()
        MyBase.New()

        ''''该调用是组件设计器所必需的。
        InitializeComponent()

        ''''在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    ''''组件重写 dispose 以清理组件列表。
    Protected Overloads Overrides Sub Dispose()Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
           &

上一页  [1] [2] [3] [4] [5] [6] [7]  下一页

打印本文 打印本文 关闭窗口 关闭窗口