在LabWindows/CVI中获取本地计算机的IP地址
主要软件:
主要软件版本: 8.0
主要软件修正版本: N/A
次要软件: LabWindows/CVI Development Systems>>Base Package
问题: 在LabWindows/CVI中,怎样程控的获得我电脑的IP地址?
解答: 为了能够程控的获得您网卡的IP地址,您可以调用
GetTCPHostAddr
函数。需要注意的是,该函数获取的是当前程序运行的电脑的默认IP地址。
GetTCPHostAddr
函数会向Windows操作系统获取所有可用的IP地址的列表,但返回的只是其中的第一个。
同样地,如果要获取该电脑的所有IP地址,可以调用
GetAllTCPHostAddresses
函数来实现。
相关链接: KnowledgeBase
3TTCFPK7: Building Networked Applications with the LabWindows/CVI TCP Support Library
附件:
报告日期: 11/17/2006
最近更新: 02/14/2008
文档编号: 3TTCFPK7
Other Support Options
Ask the NI Community
Collaborate with other users in our discussion forums
Request Support from an Engineer
A valid service agreement may be required, and support options vary by country.