问题描述
即使其他计算机访问我的网站,我的变量也会保留其价值。例如,我使用Username - User1登录了PC 1。当我在PC 2上访问该网站时,User1已经登录。希望有人可以帮我这个。
i有一个变量
public用户名为字符串
则代码为
My variables is retaining its value even if other computers accessing my website. for example, i logged in the pc 1 using Username - User1. when i access the site on pc 2, the User1 is already logged in. Hope some one could help me on this.
i have a variable
public Username as string
then the code is
Username = txtUsername.text
我将使用用户名test_user1登录到PC 1
when我访问另一台PC或计算机上的网站,用户名test_user1仍在变量Username上。
问题是为什么它在其他计算机上继承或保留变量Username的值?
i使用下面的代码
Im going to log in to PC 1 using username "test_user1"
when i access the website on another pc or computer, the username "test_user1" is still on the variable Username.
The question is why it inherit or retain the value of the variable "Username" on other computers?
i used this codes below
Protected Sub btnLogin2_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnLogin2.Click
Username = txtUsername.text
FormsAuthentication.RedirectFromLoginPage(Username, False)
Response.Redirect("~/frmMenu.aspx", False)
End Sub
它不是关于身份验证,它关于我在模块上声明的变量以及为什么它与访问我网站的其他计算机具有相同的值。
Its not about the authentication, its about the variable i declared on the module and why it has same value accross other computers accessing my website.
推荐答案
这篇关于变量在其他计算机ASP.Net VB.Net上保留了它的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!