本文整理汇总了C#中Application.LogOn方法的典型用法代码示例。如果您正苦于以下问题:C# Application.LogOn方法的具体用法?C# Application.LogOn怎么用?C# Application.LogOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application.LogOn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Task3Library
public Task3Library()
{
app = new Application();
var result = app.LogOn("TRAINING", "Administrator", "P2ssw0rd");
if (result != LogOnStatus.LoggedOn)
throw new Exception("Can't log on");
}
示例2: Main
static void Main(string[] args)
{
Application app = new Application();
LogOnStatus status = app.LogOn("TRAINING", "Eugeni.Tseitlin", "sp8hxj4v3a");
if (status != LogOnStatus.LoggedOn)
{
throw new UnauthorizedAccessException();
}
CustomIndexer.ClassificationInitializer.InitializeSpecifications(app);
}
示例3: Index
//
// GET: /Home/
public ActionResult Index()
{
Application app = new Application();
LogOnStatus status = app.LogOn("TRAINING", "Demidov", "5090588");
Console.WriteLine(status);
if (status != LogOnStatus.LoggedOn)
{
throw new UnauthorizedAccessException();
}
Session["AdamApp"] = app;
return View();
}
示例4: Main
static void Main(string[] args)
{
Application app = new Application();
LogOnStatus status = app.LogOn("LUXDAM", "Eduard_Pasmetukhau", "P2ssw0rd!");
if (status == LogOnStatus.LoggedOn)
{
Console.WriteLine("Ok");
}
else Console.WriteLine(status);
Classification c = new Classification(app);
ClassificationHelper ch = new ClassificationHelper(app);
Guid? rootGuid= ch.GetId(new SearchExpression("name = 'Luxottica Content*'"));
Console.WriteLine("List of classification with parent Luxottica Content");
//Console.ReadKey();
if (rootGuid != null)
{
ClassificationCollection classCollections = new ClassificationCollection(app);
classCollections.Load(new SearchExpression(String.Format("parent = '{0}'", rootGuid)));
foreach (Classification classification in classCollections)
{
Console.WriteLine(classification.Label + " Guid: "+classification.Id);
}
}
Console.WriteLine();
Console.ReadKey();
Console.WriteLine("First 10 Guids of Records in classification Luxottica Content");
RecordCollection rc = new RecordCollection(app);
rc.Load(new SearchExpression(String.Format("classification = '{0}'", rootGuid)));
foreach (Record r in rc.Take<Record>(10))
{
Console.WriteLine(r.Id);
}
Console.ReadKey();
}