// NetworkSocket.cpp : メイン プロジェクト ファイルです。 #include "stdafx.h" using namespace System; using namespace System::Net; using namespace System::Net::Sockets; int main(array ^args) { IPHostEntry^ ipHostEntry = Dns::GetHostEntry("wwww.server.com"); IPAddress^ ipAddress = ipHostEntry->AddressList[0]; IPEndPoint^ endPoint = gcnew IPEndPoint(ipAddress, 80); Socket^ socket = gcnew Socket(endPoint->AddressFamily, SocketType::Stream, ProtocolType::Tcp); socket->Connect(endPoint); return 0; }