• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

Is there simple way to ask from vb.net "Is this computer logged on to the Windows domain" and received Yes or No answer

My application needs to know if it is currently on our windows 2000 network domain. I would like to have the initial page contain code that asks this question and returns either Yes or No. (If yes then I will connect to MS SQL server for data, if no then use a local database).

Any help would be greatly appreciated.

Thanks MT
0
MajikTara
Asked:
MajikTara
1 Solution
 
123654789987Commented:
On the Page_Load of u'r main page u can have a call to a dialog form like this

Private Sub MainScreen_Load(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles MyBase.Load
frmLogin.ShowDialog()

End Sub

In this Login form u have have Yes, No buttons. On Click of these buttons u can set a value in a module level variable that determines if u'r computer is logged or not

 Private Sub btNo_Click( _
        ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles btNo.Click
NetworkConnected = "No"
Me.close()
End Sub

 Private Sub btYes_Click( _
        ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles btYes.Click
NetworkConnected = "Yes"
Me.Close()
End Sub

Module Test
 Public Property NetworkConnected() As String
        Get
            Return networkConnection
        End Get
        Set(ByVal Value As String)
            networkConnection= Value
        End Set
    End Property
End Module


0
 
MajikTaraAuthor Commented:
123654789987, I have read your response and see that I was not very clear in asking the question. What I was wanting was something like WNetGetUser api code where it looked only to determine if user is on our network. You get the points because you did answer my question as written.

Thanks for the help,
MT
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now