以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  openqq密码是对的却提示登录密码错误  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=117711)

--  作者:yetle
--  发布时间:2018/4/18 8:44:00
--  openqq密码是对的却提示登录密码错误
还提示:已添加了具有相同键的项。  why?
[此贴子已经被作者于2018/4/18 9:00:41编辑过]

--  作者:有点甜
--  发布时间:2018/4/18 9:04:00
--  

UserLogging事件,改代码

 

For Each dr2 As DataRow In DataTables("user").select("")
    Dim nm As String =  dr2("部门") & "." & dr2("name")
    If nm <> e.UserName Then \'如果不是登录者本人
        If e.Buddies.Contains(nm)= False Then
            e.Buddies.Add(nm)
        End If
    End If
Next


--  作者:yetle
--  发布时间:2018/4/18 9:45:00
--  
在opengqq client登录已经OK了,可是放在我的项目里面登录,还是提示登录密码错误,(登录用户表已经放在openqq服务器的,项目已经登录成功,openqq提示密码错误)

项目登陆的代码是:
Dim tx1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim user As String=tx1.text
Dim sss As String=e.Form.Controls("ComboBox2").text
 
Dim tx2 As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim pows As String=tx2.text
Dim dl As WinForm.Button = e.Form.Controls("Button1")
Dim dt As DataTable=DataTables("用户表")
Dim dr As DataRow

If user="" Then
    MessageBox.show("请输入用户名称!","提示",MessageBoxButtons.OK,MessageBoxIcon.Error)
    Return
Else
    dr=dt.find("用户名称=\'" & user & "\'")
    If dr IsNot Nothing Then
        If pows=dr("密码") Then
            PopMessage("登陆成功","提示",PopIconEnum.Infomation,1)

If QQClient.Ready Then
    MessageBox.show("QQClient已经启动,请先关闭","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If

QQClient.ServerIP = "127.0.0.1"  \'指定服务器IP地址
QQClient.ServerPort = 52177  \'指定服务器端口
QQClient.UserName = e.Form.Controls("ComboBox3").Value & "." & e.Form.Controls("ComboBox1").Value \'指定登录用户名 
\' QQClient.UserName = e.Form.Controls("ComboBox1").Value
QQClient.Password = e.Form.Controls("TextBox2").Value
If QQClient.Start() = True \'如果登录成功
    e.Form.Controls("btnChat").Enabled = True
    Dim msg As String =  "恭喜,OpenQQ登录成功!"
    If QQClient.ServerMessage > "" Then \'如果服务器返回了欢迎信息
        msg = msg & QQClient.ServerMessage
    End If
    popMessage(msg,"提示",PopiconEnum.Infomation,5)
Else \'如果登录失败,显示服务器返回错误信息
    e.Form.Controls("btnChat").Enabled = False
    PopMessage("QQClient登录失败,原因:" & vbcrlf & QQClient.ServerMessage,"提示",PopiconEnum.Error,5)
End If



            dr("登陆时间")=Date.Now
dr("登陆账套")=sss
dr.Save()
usna=user
syscmd.project.open(ProjectFile,sss)
            e.Form.close
\'syscmd.project.Exit(True)
Return
            
        Else
            MessageBox.show("密码错误","提示")
            Return
        End If
        
    Else
        MessageBox.show("用户不存在!","提示")
        Return
    End If
End If

--  作者:yetle
--  发布时间:2018/4/18 10:11:00
--  
这个问题解决了