⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 15.6.txt

📁 《Microsoft Visual C# .NET 2003开发技巧大全》源代码
💻 TXT
字号:
Listing 15.6 Communicating with a Remote Server
// Get the stream
Stream s;
try
{
s = client.GetStream();
}
catch (InvalidOperationException exc)
{
Console.WriteLine(“Cannot connect to {0}: {1}”,
gameServer, exc.Message);
return;
}
Console.WriteLine( “Connected to game server” );
string response = GetResponse(s);
Console.WriteLine( “Response\r\n--------\r\nCode: {0} Message: {1} “,
GetResponseCode(response), GetResponseData(response));
// connected begin game
StartGame( s );
client.Close();
// Wait for user response to exit
Console.WriteLine(“Press Return to exit”);
Console.Read();
client.Close();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -