zoukankan      html  css  js  c++  java
  • 关于是用dotnet获取本机IP地址+计算机名的方法

    印象中在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"第地址...目前只能这样解决,找到更好办法再补充.

  • 相关阅读:
    C#垃圾回收(GC)
    yum --enablerepo=elrepo-kernel install kernel-lt -y
    centos 查看版本
    linux 内核升级
    awk
    升级内核
    elerpo
    http://elrepo.org/tiki/tiki-index.php
    NO_TITLE
    MongoDB Find查询 1
  • 原文地址:https://www.cnblogs.com/3dxy/p/4257576.html
Copyright © 2011-2022 走看看