获取我的“电子邮件主机"的主机名 [英] Getting the Host Name for my 'email host'

查看:163
本文介绍了获取我的“电子邮件主机"的主机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用Winsock2编写Mailing Dll.它需要一个主机名.我想那是在注册表中某个隐藏的地方,我的AOL浏览器可以找到它.我在哪里找到它.有任何想法吗?

问候,


Bram:)

Hi,

I am writing a Mailing Dll,using Winsock2. It requires a Host Name. I imagine that that is somewhere hidden in the Registry, my AOL Browser, can find it. Where do I find it. Any Idea''s?

Regards,


Bram :)

推荐答案

如果您是指本地计算机的名称,则可以受益于 GetComputerName(...) [
If you mean local computer''s name, you can benefit from GetComputerNameEx(...)[^] or GetComputerName(...)[^] functions.

You can also get host name by using Winsock functions getnameinfo() or gethostbyaddr() if you have an IP address.


我认为它不需要" a "主机名.它需要适用于某些任务的" the "主机名.如果它是本地主机名,则可以使用"localhost"或"127.0.0.1".
如果它是其他服务器,则您应该已经知道它了(通常,如果不进行硬编码,而是从配置文件或注册表部分中读取它,那就更好了.
I don''t think it requires "a" hostname. It requires "the" hostname suitable for some task. if it is the local hostname, you can use "localhost" or "127.0.0.1".
If it is some other server, you should already know it (and, in general, it wold be better if you don''t hard-code, but read it from a configuration file or registry section.


这篇关于获取我的“电子邮件主机"的主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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