获得自己的IP并发送到电子邮件 [英] gain own ip and send to email

查看:85
本文介绍了获得自己的IP并发送到电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以即时创建一个可以在服务器和客户端之间发送数据的程序,但我需要服务器发送的是IP(客户端用来连接的那个) 到一个电子邮件地址或文件服务器,以便如果服务器更改路由器(运行便携式计算机,因为我需要能够随身携带它),客户端将能够访问新IP。我在Windows 10 64位操作系统上使用winsock 2.2版。我希望被指向正确的方向或给出示例
代码。谢谢。

so im creating a program that can send data between the server and client but i need the server to send is IP (the one that the client would use to connect)  to an email address or file server so that if the server changes routers (ill be running it of a portable computer because i need to be able to take it with me) that the clients will be able to gain access to the new IP. im using winsock version 2.2 on the windows 10 64 bit os. i would appreciate being pointed in the right direction or given example code. Thank you.

推荐答案

On 2/7/2018 10:41 AM,1821T写道:

On 2/7/2018 10:41 AM, 1821T wrote:


所以即时创建一个可以在服务器和客户端之间发送数据的程序,但我需要服务器发送的是IP(客户端用来连接的那个)到电子邮件地址或文件服务器,这样如果服务器更改路由器(运行它便携式计算机的
,因为我需要能够随身携带它)客户端将能够访问新IP。我在Windows 10 64位操作系统上使用winsock 2.2版。我希望被指向正确的方向或给出示例
代码。谢谢。

so im creating a program that can send data between the server and client but i need the server to send is IP (the one that the client would use to connect)  to an email address or file server so that if the server changes routers (ill be running it of a portable computer because i need to be able to take it with me) that the clients will be able to gain access to the new IP. im using winsock version 2.2 on the windows 10 64 bit os. i would appreciate being pointed in the right direction or given example code. Thank you.

发布服务器IP地址的典型方法是DNS。然后,客户端将按名称查找地址(参见例如getaddrinfo)。当服务器更改其IP地址时,只需更新DNS记录即可。对于没有固定IP地址的服务器,
考虑使用动态DNS提供程序。

A typical way to publish the server's IP address is DNS. The client would then look up the address by name (see e.g. getaddrinfo ). When the server changes its IP address, simply update the DNS record. For a server that doesn't have a fixed IP address, consider using a dynamic DNS provider.


这篇关于获得自己的IP并发送到电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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