H
hazz
Is Activator.CreateInstance(t,BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.CreateInstance, null, args, null) appropriate given the following;
**************************************
public interface IPasswordProvider
{
string GetPassword(Token token);
}
public DBPassword()
{
// constructor logic goes here
}
**************************************
public string GetPassword(Token token)
{
string sPassword;
sPassword = "password";
return sPassword;
}
**************************************
and what I have to include as an argument to pass to the GetPassword() is an instance of the following class;
public class Token
{
protected string m_strPWD;
public Token()
{
}
public string Password
{
get
{
return m_strPWD;
}
set
{
m_strPWD=value;
}
}
**************************************
for which I am attempting something like;
Token tkn = new Token();
tkn.Password = "password";
object[] args = {tkn };
but when I utilize this along with Activator.CreateInstance(t,BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.CreateInstance, null, args, null),
I get the following - {"Constructor on type DBPasswordProvider.IPasswordProvider not found." } System.Exception
**************************************
Any help will be very much appreciated...
Thank you,
-Greg
**************************************
public interface IPasswordProvider
{
string GetPassword(Token token);
}
public DBPassword()
{
// constructor logic goes here
}
**************************************
public string GetPassword(Token token)
{
string sPassword;
sPassword = "password";
return sPassword;
}
**************************************
and what I have to include as an argument to pass to the GetPassword() is an instance of the following class;
public class Token
{
protected string m_strPWD;
public Token()
{
}
public string Password
{
get
{
return m_strPWD;
}
set
{
m_strPWD=value;
}
}
**************************************
for which I am attempting something like;
Token tkn = new Token();
tkn.Password = "password";
object[] args = {tkn };
but when I utilize this along with Activator.CreateInstance(t,BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.CreateInstance, null, args, null),
I get the following - {"Constructor on type DBPasswordProvider.IPasswordProvider not found." } System.Exception
**************************************
Any help will be very much appreciated...
Thank you,
-Greg