6
Answers

Creating an instance of a class

Marc

Marc

10y
702
1
I have a method in another namespace I am trying to call that gathers the local users information.
 
namespace Tools
{
      public sealed class Methods
      {
             public void LocalUser(string user, string password)
              {
                     CreateLocalUser(user, password, new List<userAccountFlags>, string.Empty, string.Empty );
               }
      }
}
 
namespace MyApplication
{
      class LogOn
      {
               static void Main (string[] args)
               {
                     Tools tol = new Tools();
                     var locUser = tol.LocalUser()        // I want to pull this information from this method into an instance to utilize it for another method
               }
      }
}
 
I want to get the local user and password from the LocalUser method so I can utilize it in another method in MyApplication.  Is this possible?

Answers (6)