예제 #1
0
        private string inet_ntoa(NetAddress address)
        {
            IntPtr        num      = Marshal.AllocHGlobal(Marshal.SizeOf((object)address));
            StringBuilder addr_str = new StringBuilder();

            addr_str.Capacity = 46;
            Marshal.StructureToPtr((object)address, num, true);
            NetInterfaceConfig.sigar_net_address_to_string(IntPtr.Zero, num, addr_str);
            return(addr_str.ToString());
        }
예제 #2
0
파일: Sigar.cs 프로젝트: murisfurder/sigar
        private string inet_ntoa(NetAddress address)
        {
            //XXX seems a little stilly, we can't use &address
            IntPtr        ptr    = Marshal.AllocHGlobal(Marshal.SizeOf(address));
            StringBuilder buffer = new StringBuilder();

            buffer.Capacity = 46;
            Marshal.StructureToPtr(address, ptr, true);
            sigar_net_address_to_string(IntPtr.Zero, ptr, buffer);
            return(buffer.ToString());
        }
예제 #3
0
 private string inet_ntoa(NetAddress address) {
     //XXX seems a little stilly, we can't use &address
     IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(address));
     StringBuilder buffer = new StringBuilder();
     buffer.Capacity = 46;
     Marshal.StructureToPtr(address, ptr, true);
     sigar_net_address_to_string(IntPtr.Zero, ptr, buffer);
     return buffer.ToString();
 }