// 设置本地连接的 IP 地址、子网掩码和网关信息; WinExec('cmd.exe /c netsh.exe interface ip set address name="本地连接" source=static addr=192.168.1.1 mask=255.255.255.0 gateway=192.168.1.254 gwmetric=1', SW_HIDE); // 设置本地连接中的第一个 DNS 服务器地址; WinExec('cmd.exe /c netsh.exe interface ip set dns name="本地连接 source=static addr=219.150.32.132', SW_HIDE); // 添加本地连接中的第二个 DNS 服务器地址; WinExec('cmd.exe /c netsh.exe interface ip add dns name="本地连接" addr=202.99.96.68', SW_HIDE);
C++的行不?Client: Included in Windows XP, Windows 2000 Professional. Server: Included in Windows Server 2003, Windows 2000 Server. Header: Declared in Windns.h. Library: Use Dnsapi.lib.
同志们帮一下呀?我不是专职程序员,而是一名网管。现在想实现用delphi来进行DNS的A纪录MX记录的修改。如何做?
Delphi如何操作WMI.如何使用ADSI脚本呀?有没有人搞过?急盼。
WinExec('cmd.exe /c netsh.exe interface ip set address name="本地连接" source=static addr=192.168.1.1 mask=255.255.255.0 gateway=192.168.1.254 gwmetric=1', SW_HIDE);
// 设置本地连接中的第一个 DNS 服务器地址;
WinExec('cmd.exe /c netsh.exe interface ip set dns name="本地连接 source=static addr=219.150.32.132', SW_HIDE);
// 添加本地连接中的第二个 DNS 服务器地址;
WinExec('cmd.exe /c netsh.exe interface ip add dns name="本地连接" addr=202.99.96.68', SW_HIDE);
最后没办法我用DNSCMD来实现,不过这样实现不完美,请各位大师继续关注。
C++的行不?Client: Included in Windows XP, Windows 2000 Professional.
Server: Included in Windows Server 2003, Windows 2000 Server.
Header: Declared in Windns.h.
Library: Use Dnsapi.lib.
DnsAcquireContextHandle
DnsExtractRecordsFromMessage
DnsModifyRecordsInSet
DnsNameCompare
DnsQuery
DnsQueryConfig
DnsReleaseContextHandle
DnsRecordCompare
DnsRecordCopyEx
DnsRecordListFree
DnsRecordSetCompare
DnsRecordSetCopyEx
DnsRecordSetDetach
DnsReplaceRecordSet
DnsValidateName
DnsWriteQuestionToBuffer
如果是外部设备,那么你需要该设备的说明书。然后通过TCP或者UDP连接该设备,并发送该设备识别的指令进行控制。比如我控制自己的路由器就是通过http协议完成的。