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, 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?
VulpesPosted Oct 9, 2014, 9:34 AM
MarcPosted Oct 9, 2014, 11:01 AM
VulpesPosted Oct 9, 2014, 9:00 AM
BTW I've only hard-coded some values for 'user' and 'password' to indicate that something will need to be passed to the LocalUser method. I imagine you'll be getting these 'dynamically' in practice.
MarcPosted Oct 9, 2014, 8:46 AM
VulpesPosted Oct 9, 2014, 8:40 AM
So, you'll either need to change the method so that it does return a value or change:
var locUser = meth.LocalUser(user, password);
to simply:
meth.LocalUser(user, password);
VulpesPosted Oct 9, 2014, 8:34 AM
or like this: