所以,我正在做一个asp.net登录。我想,人们用它来搭配一个id在我的SQL数据库的登录名。所以,我可以取回他们的信息。但是,目前,当我使用code以下,从中我得到我目前的计算机的名称。不过,我希望用户身份是
他们写的东西在
用户名文本
在登录屏幕上。
So I'm making a asp.net login. I want the login name that people use to match an id in my SQL database. So that I can retrieve their information. But currently when I use the code below, from which I get the name of the computer I am currently on. However I would like the user Identity to be
what they write in
the username textbox
at the login screen.
If HttpContext.Current.User.Identity.IsAuthenticated Then
Dim userName As String = HttpContext.Current.User.Identity.Name
Response.Write(userName)
End If
所以,我看着它在网上,我认为它可能是与我的web.config文件。当我完全陌生asp.net我不知道。但这里是我的Web.config文件的一部分。
So I looked for it on net and I think it might have something to do with my web.config file. As I'm totally new to asp.net I wouldn't know. However here's a part of my Web.config file.
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH"
loginUrl="Login.aspx"
protection="All"
timeout="30"
path="/" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
所以任何想法? :)
so any ideas? :)
设置使用登录名
FormsAuthentication.RedirectFromLoginPage(UserName.Text, RememberMe.Checked);
和retrive使用
User.Identity.Name
引用链接, bytes.com 和 asp.net教程
上一篇:使用NDK建立时未定义的OpenCV /非自由/ features2d未定义、自由、NDK、features2d
下一篇:java.io.FileNotFoundException:即使访问被拒绝,虽然我在AndroidManifest推权限我在、被拒、权限、io