印象中在maxscript帮助文档里找到过方法,但是当时没记下来.只能通过dotnet实现了.

如果电脑有无线网卡和本地连接,可能会出现乱码,也问了写dotnet的朋友,提供了一些思路,不过最终还是使用了这个笨办法.

fn getIP_PCname =
(
    cc = (dotnetclass "System.Net.Dns")
    oo = cc.GetHostAddresses(cc.GetHostName())
    for ip = 1 to oo.count do
    (
        getip = filterString (oo[ip].tostring()) "."
        if getip.count > 0 and (finditem getip "192") != 0 do
        return (IP_pcname = oo[ip].tostring() + "@" + cc.GetHostName()) -- = sysinfo.computername
    )
)--获取本机IP地址与计算机名

把获得的所有地址循环一遍,使用含有"192"第地址...目前只能这样解决,找到更好办法再补充.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2021-12-21
  • 2021-09-17
  • 2021-09-19
  • 2021-12-25
猜你喜欢
  • 2021-06-19
  • 2021-12-02
  • 2022-01-03
  • 2021-08-31
  • 2021-05-26
相关资源
相似解决方案