哪位知道如何获得和修改本机的ip地址,不用vb也行,能给多少给多少分!

iwindy 2002-06-06 09:57:53
哪位知道如何获得和修改本机的ip地址?
...全文
194 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
孙小雄 2002-06-06
  • 打赏
  • 举报
回复
我查了有关资料

首先你必须是 win2000 pk2


DWORD AddIPAddress(
IPAddr Address, // IP address to add
IPMask IpMask, // subnet mask for IP address
DWORD IfIndex, // index of adapter
PULONG NTEContext, // Net Table Entry context
PULONG NTEInstance // Net Table Entry Instance
);
Parameters
Address
[in] Specifies the IP address to add to the adapter.
IpMask
[in] Specifies the subnet mask for the IP address.
IfIndex
[in] Specifies the adapter to which to add the address.
NTEContext
[out] Pointer to a ULONG variable that points to the Net Table Entry (NTE) context for this IP address. The caller can later use this context in a call to DeleteIPAddress.
NTEInstance
[out] Pointer to a ULONG variable that points to the NTE instance for this IP address.






DWORD GetAdapterIndex(
LPWSTR AdapterName, // name of the adapter
PULONG IfIndex // index of the adapter
);
Parameters
AdapterName
[in] Pointer to a Unicode string that specifies the name of the adapter.
IfIndex
[out] Pointer to a ULONG variable that points to the index of the adapter.








DWORD DeleteIPAddress(
ULONG NTEContext // net table entry context
);
Parameters
NTEContext
[in] Specifies the Net Table Entry (NTE) context for the IP address. This context was returned by the previous call to AddIPAddress.



iwindy 2002-06-06
  • 打赏
  • 举报
回复
winsock控件的localip属性可以修改ip地址吗?
kwq_cn 2002-06-06
  • 打赏
  • 举报
回复
最简单的方法:用winsock控件的localip属性
iwindy 2002-06-06
  • 打赏
  • 举报
回复
真的没人会吗?不会吧!
acptvb 2002-06-06
  • 打赏
  • 举报
回复
感谢您使用微软产品。

您可以使用Windows Sockets的API函数GetHostByName通过本机的Host Name获得包含本机ip地址的Sockets信息,为了获得本机的标准Host Name,您还需要调用API函数GetHostName。

以下链接提供了详细的示例代码。
Q160215 HOWTO: Obtain the Host IP Address Using Windows Sockets
http://support.microsoft.com/support/kb/articles/q160/2/15.asp

您可以用wmi方式修改本机的IP地址,如下例:

Private Sub Command1_Click()

WQL = "Select * From Win32_NetworkAdapter Where AdapterType='Ethernet 802.3'"

Set NetworkAdapters = GetObject("winmgmts:").ExecQuery(WQL)

ipaddr = Array("202.60.115.7")
subnet = Array("255.255.255.0")

For Each Adapter In NetworkAdapters

Dim RetVal

WQL = "winmgmts:Win32_NetworkAdapterConfiguration=" & Adapter.DeviceID
Set NIC = GetObject(WQL)

RetVal = NIC.EnableStatic(ipaddr, subnet)

If RetVal = 0 Then
MsgBox "Static IP Enabled"
Else
MsgBox "Static IP Failed"
End If
Next
End Sub

详细信息请参考:
EnableStatic Method in Class Win32_NetworkAdapterConfiguration
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/enablestatic_method_in_class_win32_networkadapterconfiguration.asp

- 微软全球技术中心 VB技术支持

本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款
(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
为了为您创建更好的讨论环境,请参加我们的用户满意度调查
(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。
内容概要:本报告基于寻汇与万事达卡在2026年联合发布的《超越自动化:定义智能体驱动的全球支付》白皮书,系统析了AI智能体在B2B跨境支付领域的应用与发展。报告指出,传统跨境支付存在效率低、人工干预多、合规风险高等问题,当前正从数字化、数据化迈向“自主化”新阶段。AI智能体可在授权下自主完成支付、换汇、合规审核、对账等全流程操作,核心技术包括深度强化学习、自然语言处理和图神经网络,用于路径优化、合规解析与异常检测。报告揭示了决策可解释性不足、跨系统协同标准缺失、安全审计机制缺位三大研究空白,并探讨了法律责任归属、监管碎片化、数据主权与技术可靠性四大现实挑战。寻汇与万事达卡的合作构建了“智能体编排引擎”与全球合规决策网络,首次提出L0-L5的智能体自主化等级框架,推动业标准化。预计2026至2027年将实现首批大规模商业部署,提升支付效率超30%。; 适合人群:金融科技研究人员、AI技术开发者、跨境支付业从业者、企业财资管理人员及政策监管机构相关人员。; 使用场景及目标:①理解AI智能体在跨境支付中的技术架构与应用场景;②把握自主化支付的演进趋势与商业化前景;③为金融机构和技术公司布局AI驱动型支付系统提供战略参考;④助力监管机构制定适应智能体时代的合规框架。; 阅读建议:本报告兼具技术深度与产业视野,建议结合白皮书原文及相关技术文献对照研读,重点关注智能体决策逻辑、合规实现机制与跨系统集成方案,并关注后续试点项目的实际成效与监管反馈。

7,787

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧