以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  怎样设置user.name  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=137132)

--  作者:echo
--  发布时间:2019/6/28 12:07:00
--  怎样设置user.name
用默认用户绕过了系统登陆窗口,用自定义登陆窗口登陆,这时候再调用user.name,会一直显示是默认用户,这时候怎么再把user.name设置为用自定义登陆窗口登陆的用户名。比如:user.name = "张三"
--  作者:有点甜
--  发布时间:2019/6/28 12:11:00
--  

 

你用自己的登陆窗口了,那就有 _username 、_usergroup 等变量的值了吧?为什么还要用 user.name ?

 

 


--  作者:echo
--  发布时间:2019/6/28 12:17:00
--  
原来项目里面用的都是username,现在改成自定义登陆窗口,所有要把原来的变量都改过来,异常麻烦,所有要设置回去比较省事


--  作者:有点甜
--  发布时间:2019/6/28 12:20:00
--  

全局代码

 

Public Class UserInfo
    Public Shared Name As String
    Public Shared Group As String
    Public Shared Roles As String
\'    Public Shared Default As Boolean
    Public Shared Type As UserTypeEnum
    Public Shared ExtendedValues As String
    Public Shared Function isRole(r As String) As Boolean
        Dim result As Boolean = False
        Dim Values() As String
        Values = roles.split(",")        
        For Index As Integer = 0 To Values.Length - 1
            If values(Index) = r Then
                result = True
                Exit For
            End If
        Next
        Return result
    End Function
End Class
 
Public user As UserInfo

--  作者:echo
--  发布时间:2019/6/28 12:36:00
--  
谢谢