本文整理汇总了C#中CommandReader.Close方法的典型用法代码示例。如果您正苦于以下问题:C# CommandReader.Close方法的具体用法?C# CommandReader.Close怎么用?C# CommandReader.Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandReader
的用法示例。
在下文中一共展示了CommandReader.Close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoginAsync
//.........这里部分代码省略.........
OsType = "winnt",
OsVersion = "5.0",
Architecture = "1386",
LibraryName = "MSMSGS",
ClientVersion = "5.0.0482",
ClientName = "WindowsMessenger",
LoginName = credentials.LoginName,
};
await responseTracker.GetResponseAsync<ClientVersionCommand>(clientVersionCommand, defaultTimeout);
var userCommand = new AuthenticateCommand("TWN", "I", credentials.LoginName);
var userResponse = await responseTracker.GetResponseAsync(userCommand, new Type[] { typeof(AuthenticateCommand), typeof(TransferCommand) }, defaultTimeout);
if (userResponse is AuthenticateCommand)
{
authTicket = (userResponse as AuthenticateCommand).Argument;
}
else if (userResponse is TransferCommand)
{
TransferCommand transferResponse = userResponse as TransferCommand;
if (transferCount > 3)
throw new InvalidOperationException("The maximum number of redirects has been reached.");
transferCount++;
endPoint = SocketEndPoint.Parse(transferResponse.Host);
commandsDisposable.Dispose();
reader.Close();
writer.Close();
connection.Dispose();
}
}
PassportAuthentication auth = new PassportAuthentication();
string authToken = await auth.GetToken(credentials.LoginName, credentials.Password, authTicket);
var authCommand = new AuthenticateCommand("TWN", "S", authToken);
var authResponse = await responseTracker.GetResponseAsync<AuthenticateCommand>(authCommand, defaultTimeout);
var synCommand = new SynchronizeCommand(syncTimeStamp1 ?? "0", syncTimeStamp2 ?? "0");
var synResponse = await responseTracker.GetResponseAsync<SynchronizeCommand>(synCommand, defaultTimeout);
IDisposable syncCommandsSubscription = null;
List<Command> syncCommands = null;
if (synResponse.TimeStamp1 != syncTimeStamp1 || synResponse.TimeStamp2 != syncTimeStamp2)
{
syncCommands = new List<Command>();
Type[] syncTypes = new Type[] {
typeof(MessageCommand),
typeof(UserCommand),
typeof(GroupCommand),
typeof(LocalPropertyCommand),
typeof(PrivacySettingCommand),
};