How can I pass Login info (userID, password, server, database) from the Login form to the mainform before Load event is fired in the main form?
The reason being that I need to capture the Login info to populate the main form. I appreciate your help. S.
mattyboy
I tried using environment variable, and I can't figure out how to set them, if you get a chance, could you tell me the method used for setting them, are they used like session variables in ASP? Thanks
Actually .NET has getEnvironment to get details from the Enviornment but there is nothing to set it. So what you need to do is declare an API call for setting the environment details something like the one below
Private Declare Ansi Function SetEnvironmentVariable Lib "kernel32.dll" Alias "SetEnvironmentVariableA" (ByVal lpName As String, ByVal lpValue As String) As Integer
and then use this to set the details to Environment and then use System.Environment.GetEnvironmentVariable to read it back. Hope this will help you.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.