打印本文 打印本文 关闭窗口 关闭窗口
VB.NET中的组件开发
作者:武汉SEO闵涛  文章来源:敏韬网  点击数4435  更新时间:2009/4/23 19:01:27  文章录入:mintao  责任编辑:mintao

先看段组件的代码:(临时写的,写得比较乱)


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''                                                              ''''
''''             登录验证组件                                     ''''
''''                                                              ''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Imports System.Security.Cryptography
Imports System.Text
Imports System.Data
Imports System.Data.SqlClient

Public Class ValidatorClass Validator
    Inherits System.ComponentModel.Component

    Private username As String
    Private userpwd As String

    Public Property vUsername()Property vUsername() As String
        Get
            Return username
        End Get
        Set(ByVal Value As String)
            username = Value
        End Set
    End Property

    Public Property vUserpwd()Property vUserpwd() As String
        Get
            Return userpwd
        End Get
        Set(ByVal Value As String)
            userpwd = Value
        End Set
    End Property

    ''''转换为MD5
    Private Function convertMD5()Function convertMD5(ByVal pwd As String) As String

        Dim md5 As New MD5CryptoServiceProvider
        Dim password As Byte() = (New ASCIIEncoding).GetBytes(pwd)

        ''''转换为哈希值Byte数组
        Dim mdByte As Byte() = md5.ComputeHash(password)
        ''''Dim mdString

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

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