本文整理汇总了C#中Properties.keys方法的典型用法代码示例。如果您正苦于以下问题:C# Properties.keys方法的具体用法?C# Properties.keys怎么用?C# Properties.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Properties
的用法示例。
在下文中一共展示了Properties.keys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
Properties pps = new Properties();
if ( System.IO.File.Exists(DEFAULT_FILE) )
LoadLeapPropertiesFile();
else
p = new ProfileImpl();
if (args.Length > 0)
{
pps = jade.Boot.parseCmdLineArgs(args);
if (pps != null)
{
java.util.Enumeration en = pps.keys();
while ( en.hasMoreElements() )
{
string key = (string) en.nextElement();
string prop = pps.getProperty(key);
p.setParameter(key, prop);
}//End WHILE block
}//End IF block
}//End IF block
/* VERSIONE 3.2 */
jade.wrapper.AgentContainer mc = null;
/* VERSIONE 3.1 */
//jade.wrapper.MainContainer mc = null;
try
{
if (p.getParameter("main", "true").Equals("false"))
mc = Runtime.instance().createAgentContainer(p);
else
mc = Runtime.instance().createMainContainer(p);
}
catch(Exception exc)
{
Console.WriteLine( "\n----------- INIZIO ECCEZIONE ------------------" );
Console.WriteLine( exc.Message );
Console.WriteLine( exc.InnerException );
Console.WriteLine( "\n----------- FINE ECCEZIONE ------------------" );
}
Console.ReadLine();
}
示例2: getControllers
/**
* Creates a vector of SampleController plugins.
*
* @param properties
* The properties with information about the samplers
* @return The Controllers value
*/
// TODO - does not appear to be called directly
public static Vector<Object> getControllers(Properties properties)
{
String name = "controller."; // $NON-NLS-1$
Vector<Object> v = new Vector<Object>();
Enumeration<?> names = properties.keys();
while (names.hasMoreElements()) {
String prop = (String) names.nextElement();
if (prop.startsWith(name)) {
Object o = instantiate(properties.getProperty(prop),
"org.apache.jmeter.control.SamplerController"); // $NON-NLS-1$
v.addElement(o);
}
}
return v;
}