I found an interesting page related to this problem. (although it is mentioning C#.)
So what I had to do was to write my own code in C++/CLI. It was just to put proper notations. But I found this page was a kind of old documents because some functions were obsolete.
At last, I wrote a new C++/CLI version after reading the page.
===============================================
#include "stdafx.h"
using namespace System;
using namespace System::Net;
int main(array
{
String^ name = (args->Length < 1) ? Dns::GetHostName() : args[0];
try{
array
int i = 0;
while(i < addrs->Length){
Console::WriteLine("{0}/{1}",name,addrs[i]);
i++;
}
}catch(Exception^ e){
Console::WriteLine(e->Message);
}
Console::ReadLine(); //waiting for pushing Enter
return 0;
}
===============================================
It is just the beginning. I will start for higher levels.
No comments:
Post a Comment