Dns部分的Dns.GetHostEntry()加注:“不允许输入类型名称” [英] Dns.GetHostEntry() raise for the Dns part: "type name is not allowed"

查看:64
本文介绍了Dns部分的Dns.GetHostEntry()加注:“不允许输入类型名称”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用vs社区2017。

I'm using vs community 2017.

我的定义是:

使用命名空间系统;

使用命名空间System :: Net;

使用命名空间System :: Net :: Sockets;

使用命名空间System :: Text;

using namespace System;
using namespace System::Net;
using namespace System::Net::Sockets;
using namespace System::Text;

这些行不起作用:

    IPHostEntry ipHostInfo = Dns.GetHostEntry(Dns.GetHostName());

    IPAddress ipAddress = ipHostInfo.AddressList [0];

    IPEndPoint localEndPoint = gcnew IPEndPoint(ipAddress,500);

   IPHostEntry ipHostInfo = Dns.GetHostEntry(Dns.GetHostName());
   IPAddress ipAddress = ipHostInfo.AddressList[0];
   IPEndPoint localEndPoint = gcnew IPEndPoint(ipAddress, 500);

它为Dns部分提出"不允许输入类型名称"。

It raises for the Dns part "type name is not allowed".

BTW,当我右键单击Dns时,它会打开'对象浏览器'。

BTW, when I right click on Dns, it opens the 'Object Browser'.

任何帮助都将不胜感激。

Any help will be appreciated.

感谢您提前。

推荐答案

您好了RatsonK,

Hi RatsonK,

欢迎来到MSDN论坛。

Welcome to the MSDN forum.

参考您的描述,你的问题是关于C ++开发。由于我们的论坛是讨论VS IDE,我将帮助您将此主题移至相应的论坛以获得更好的支持,感谢您的理解。

Refer to your description, your issue is about the C++ development. Since our forum is to discuss the VS IDE, I will help you move this thread to the appropriate forum for a better support, thank you for your understanding.

致以最诚挚的问候,

Sara


这篇关于Dns部分的Dns.GetHostEntry()加注:“不允许输入类型名称”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆