I want a common sign on solution developed in VB.NET for my company's software. For this I require the full domain name of the server. But my problem is that I don't have any idea about how to do so. Someone suggested me to use Environ("USERDNSDOMAIN"), but since I am not an expert in VB.NET I need your guidance on how to use it. Below is my code:
Code:Public Class MyForm Inherits System.Web.UI.Page #MyCode "My Generated Code" <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub Protected WithEvents txtDomain As System.Web.UI.WebControls.TextBox Protected WithEvents lblName As System.Web.UI.WebControls.Label Protected WithEvents btnRefresh As System.Web.UI.WebControls.Button Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init InitializeComponent() End Sub #End MyCode Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load txtDomain.Text = "Test" End Sub Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click txtDomain.Text = System.Environment.GetEnvironmentVariable("USERDNSDOMAIN") End Sub End Class
Bookmarks