本文整理汇总了C#中Agent类的典型用法代码示例。如果您正苦于以下问题:C#Agent类的具体用法?C#Agent怎么用?C#Agent使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:TestAccess
publicvoidTestAccess()
{
varagent=newAgent().Face
();
agent["Access"]=newBin();
agent.Init("stream",typeof(Stream),false);
try
{
varf=agent["stream"].First;
}
catch(Exceptione)
{
Assert.Inconclusive(e.ToString());
}
Assert.AreEqual(false,agent["Access"].First);
Assert.AreEqual(1,agent["Access"].Count);
agent.Init("Secure",true);
agent["Secure"].Add(true);
Assert.AreEqual(true,agent["Secure"][1]);
Assert.AreEqual(2,agent["Secure"].Count);
}
原文链接:http://www.jxszl.com/biancheng/C/556496.html