📄 netbasic.cpp
字号:
// IPAddr represents workstations network address
// NetSender - Interface for network sending provider
// NetReceiver - Interface for network receiving provider
// Implementation file
//
// (c) Lev Naumov, CAMEL Laboratory
// E-mail: camellab@mail.ru
// For more information see http://camel.ifmo.ru or
// http://www.codeproject.com/internet/ctp.asp
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "NetBasic.h"
bool IPAddr::FromString(LPTSTR s)
{
Bytes.b1=(unsigned char)atoi(s);
s=strchr(s,'.');
if (!s) {SetLocalhost(); return false;}
s++;
Bytes.b2=(unsigned char)atoi(s);
s=strchr(s,'.');
if (!s) {SetLocalhost(); return false;}
s++;
Bytes.b3=(unsigned char)atoi(s);
s=strchr(s,'.');
if (!s) {SetLocalhost(); return false;}
s++;
Bytes.b4=(unsigned char)atoi(s);
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -