try
{ if(this.Context!=null)
{StringDictionary parameters = Context.Parameters;
string[] keys =new string[parameters.Count];
parameters.Keys.CopyTo(keys,0);
// Set the StateServer collection values
for(int intKeys=0;intKeys<keys.Length;intKeys++)
{
if(keys[intKeys].Equals("database"))
stateSaver.Add("database",
parameters[keys[intKeys]].ToString());
else if(keys[intKeys].Equals("server"))
{stateSaver.Add("server",
parameters[keys[intKeys]].ToString());}
else if(keys[intKeys].Equals("username"))
{stateSaver.Add("username",
parameters[keys[intKeys]].ToString());}
else if(keys[intKeys].Equals("password"))
{stateSaver.Add("password",
parameters[keys[intKeys]].ToString());}
else if(keys[intKeys].Equals("target"))
{stateSaver.Add("target",
parameters[keys[intKeys]].ToString());}
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/