以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  错误提示  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=117689)

--  作者:yetle
--  发布时间:2018/4/17 16:34:00
--  错误提示
将study的openqq的client网络监视器代码放在自己的项目网络监视器后有错误提示
.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2018.3.9.1
错误所在事件:项目,Server
详细错误信息:
索引超出了数组界限。

client登陆代码放在自己的项目登陆代码里面错误提示
.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2018.3.9.1
错误所在事件:窗口,登陆,Button1,Click
详细错误信息:
未设置对象变量或 With 块变量。


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("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/17 16:41:00
--  
应该是自己项目里面用户名没有取部门,而openQQ服务器登陆代码里面有取部门值而导致的
[此贴子已经被作者于2018/4/17 16:41:42编辑过]

--  作者:有点甜
--  发布时间:2018/4/17 16:42:00
--  

用户名,是分组名+用户组合而成的,改一下代码,如

 

QQClient.UserName = "分组名." & e.Form.Controls("ComboBox1").Value \'指定登录用户名
QQClient.Password = e.Form.Controls("TextBox2").Value

--  作者:yetle
--  发布时间:2018/4/17 16:57:00
--  
加了:
QQClient.UserName = e.Form.Controls("ComboBox3").Value & "." & e.Form.Controls("ComboBox1").Value 
QQClient.Password = e.Form.Controls("TextBox2").Value
但还是有错误提示:
找不到btnchat组件
和下面提示:
.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2018.3.9.1
错误所在事件:窗口,登陆,Button1,Click
详细错误信息:
未设置对象变量或 With 块变量。


--  作者:有点甜
--  发布时间:2018/4/17 17:01:00
--  
你窗口没有叫做【btnchat】的按钮或者控件吧?