| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1695 人关注过本帖, 1 人收藏
标题:VB代码
取消只看楼主 加入收藏
youshuling520
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2008-5-25
收藏(1)
 问题点数:0 回复次数:2 
VB代码
请问有那位高手可以帮我解释下这些代码什么意思????

Imports System.Data.SqlClient
Public Class Login
    Inherits System.Windows.Forms.Form
    Dim conn As System.Data.SqlClient.SqlConnection

    Public Function GetUserInf() As Boolean
        Try
            If TextBox1.Text = "" Then
                Me.Label3.Text = "用户名为空"
            Else
                If TextBox2.Text = "" Then
                    Me.Label3.Text = "密码为空"
                Else
                    Dim sp As SqlParameter
                    Dim cmd As New SqlCommand("p_Admin", conn)
                     = CommandType.StoredProcedure
                    sp = New SqlParameter
                    sp.ParameterName = "@c_AdminName"
                    sp.SqlDbType = SqlDbType.VarChar
                    sp.Size = 20
                    sp.Value = TextBox1.Text
                    cmd.Parameters.Add(sp)

                    sp = New SqlParameter
                    sp.ParameterName = "@c_AdminPassWord"
                    sp.SqlDbType = SqlDbType.VarChar
                    sp.Size = 20
                    sp.Value = TextBox2.Text
                    cmd.Parameters.Add(sp)

                    Dim sc As String = CType(cmd.ExecuteScalar(), String)
                    cmd.Dispose()
                    If sc <> "0" Then
                        Return True
                    Else
                        Me.Label3.Text = "用户名或密码错误"
                    End If
                End If
            End If
        Catch ex As Exception
            Return False
        End Try
        Return False

    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Login As New index
        If GetUserInf() Then
            Login.Show()
            Me.Finalize()     '隐藏原窗体
        End If
    End Sub

    Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        conn = New System.Data.SqlClient.SqlConnection("workstation id=JOLIN;packet size=4096;integrated security=SSPI;data source='.';persist security info=False;initial catalog=WageManage")
        conn.Open()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub

End Class
搜索更多相关主题的帖子: 代码 Dim System Else Data 
2008-05-29 22:43
youshuling520
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2008-5-25
收藏
得分:0 
尽量详细点  谢谢
2008-05-29 22:55
youshuling520
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2008-5-25
收藏
得分:0 
C++和VB会一样吗?真是的~~~~~现在应该用.ENT平台~~人家不是不懂才问,搞得你懂很了不起,你还不是从不懂到懂~~~~VB的东西不发这里,发那里,真搞笑~~~~~~
2008-05-30 20:45
快速回复:VB代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016909 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved