本文整理汇总了C++中Computer::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ Computer::ToString方法的具体用法?C++ Computer::ToString怎么用?C++ Computer::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Computer
的用法示例。
在下文中一共展示了Computer::ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char * argv[])
{
#ifdef STARTSYNERGYSERVICE
if (argc >= 1)
{
StartSynergyService(argv[0]);
}
#endif
char monitor_name[128];
if (argc < 2)
{
SetConsoleColor(COMMANDCOLOR);
cout << "please input monitor name:" << endl;
SetConsoleColor(INITCOLOR);
//cin >> monitor_name;
strcpy_s(monitor_name, "davy-pc");
//strcpy_s(monitor_name, "xbu-pc");
}
else
{
strcpy(monitor_name, argv[1]);
}
//cout << monitor_name << endl;
ComputerMonitor monitor_computer;
Computer::QueryHostIPbyName(monitor_name, monitor_computer);
cout << "The monitor is :" << monitor_computer.GetHostname() << endl;
cout << "The monitor's IP is:" << monitor_computer.GetIP() << endl;
char * myself_hostname = myself_computer.GetHostname();
myself_computer.SetMonitorHostname(monitor_computer.GetHostname());
myself_computer.SetMonitorIP(monitor_computer.GetIP());
Computer::QueryHostIPbyName(myself_hostname, myself_computer);
myself_computer.ToString();
if (myself_computer.AmIaMonitor())
{
cout << "I am a monitor." << endl;
int numof_connection = 0;
SetConsoleColor(COMMANDCOLOR);
cout << "How many Client do you want to connect:" << endl;
SetConsoleColor(INITCOLOR);
cin >> numof_connection;
ComputerMonitor myself_computermonitor(myself_computer);
HANDLE handle = (HANDLE)_beginthreadex(NULL, 0, MonitorAsClientToo, NULL, 0, NULL);
myself_computermonitor.ConnectWithClient(numof_connection);
#ifdef SELFCONFIG
myself_computermonitor.Configuration(numof_connection);
#endif
myself_computermonitor.BegintoWork();
}