client.cpp
来自「.NET Remoting(下文简称Remoting)是一种可用于开发分布式应用」· C++ 代码 · 共 26 行
CPP
26 行
// 这是使用应用程序向导生成的 VC++
// 应用程序项目的主项目文件。
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Channels;
using namespace System::Runtime::Remoting::Channels::Tcp;
using namespace RemoteObject;
int _tmain()
{
TcpClientChannel *Channel=new TcpClientChannel();
ChannelServices::RegisterChannel(Channel);
RemoteObjClass *pObj=static_cast<RemoteObjClass *>(Activator::GetObject(Type::GetType("RemoteObject.RemoteObjClass,RemoteObject"),S"tcp://localhost:8888/Test"));
Console::WriteLine(S"Return String is:{0}",pObj->DisplayMessage());
Console::ReadLine();
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?