本文整理汇总了C#中IUserSession.StartApplicationOnlyAuth方法的典型用法代码示例。如果您正苦于以下问题:C# IUserSession.StartApplicationOnlyAuth方法的具体用法?C# IUserSession.StartApplicationOnlyAuth怎么用?C# IUserSession.StartApplicationOnlyAuth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUserSession
的用法示例。
在下文中一共展示了IUserSession.StartApplicationOnlyAuth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoUserAccountTest
//.........这里部分代码省略.........
if (deleteUserBlock.OK)
ConsoleOutput.PrintMessage(String.Format("ScreenName: {0}", deleteUserBlock.ScreenName));
else
successStatus = false;
}
// 7
if (testSeq.Contains(7))
{
ConsoleOutput.PrintMessage("1.7 UsersExtensions\\GetUsersDetailsFull From Screennames ",
ConsoleColor.Gray);
var screennames = new List<string> {"shiftkey", "katyperry"};
var getUserDetailsFullFromScreenNames = await session.GetUsersDetailsFull(screenNames: screennames);
if (getUserDetailsFullFromScreenNames.OK)
{
ConsoleOutput.PrintMessage(String.Format("Returned: {0}",
getUserDetailsFullFromScreenNames.Count()));
foreach (var u in getUserDetailsFullFromScreenNames)
{
ConsoleOutput.PrintMessage(String.Format("User ID: {1} // ScreenName: {0} // Description: {2}",
u.Name, u.UserId, u.Description));
}
}
else
successStatus = false;
}
// 8
if (testSeq.Contains(8))
{
ConsoleOutput.PrintMessage("1.8 UsersExtensions\\GetUsersDetailsFull From IDs", ConsoleColor.Gray);
var usersids = new List<long> { 21447363, 14671135, 4503599627370241};
var getUserDetailsFullFromIDs = await session.GetUsersDetailsFull(userIds: usersids);
if (getUserDetailsFullFromIDs.OK)
{
ConsoleOutput.PrintMessage(String.Format("Returned: {0}", getUserDetailsFullFromIDs.Count()));
foreach (var u in getUserDetailsFullFromIDs)
{
ConsoleOutput.PrintMessage(String.Format(
"ScreenName: {0} User ID: {1} Description: {2}",
u.Name, u.UserId, u.Description));
}
}
else
successStatus = false;
}
// 9
if (testSeq.Contains(9))
{
ConsoleOutput.PrintMessage("1.9 UsersExtensions\\SearchForUsers", ConsoleColor.Gray);
var q = "troll";
var searchForUsers = await session.SearchForUsers(q, 200, 1);
if (searchForUsers.OK)
{
ConsoleOutput.PrintMessage(String.Format("Returned: {0}", searchForUsers.Count()));
foreach (var u in searchForUsers)
{
ConsoleOutput.PrintMessage(String.Format(
"ScreenName: {0} User ID: {1} Description: {2}",
u.Name, u.UserId, u.Description));
}
}
else
successStatus = false;
}
// 10
if (testSeq.Contains(10))
{
ConsoleOutput.PrintMessage("1.10 Get GetConfiguration", ConsoleColor.Gray);
var configUser = await session.GetConfiguration();
if (configUser.OK)
{
ConsoleOutput.PrintMessage(String.Format("Returned for Max Media Per Upload: {0}", configUser.MaxMediaPerUpload));
ConsoleOutput.PrintMessage(String.Format("Returned for Max Chars for DM: {0}", configUser.DirectMessageCharacterLimit));
}
else
successStatus = false;
}
// 11
if (testSeq.Contains(11))
{
ConsoleOutput.PrintMessage("1.11 Start ApplicationOnlyAuth", ConsoleColor.Gray);
var getAuthToken = await session.StartApplicationOnlyAuth();
if (getAuthToken)
{
ConsoleOutput.PrintMessage(String.Format("Returned: {0}", getAuthToken));
}
else
successStatus = false;
}
}
catch (Exception e)
{
ConsoleOutput.PrintError(e.ToString());
return false;
}
return successStatus;
}