• 大小: 0.04M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: 局域网  IP  C#  地址  

资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections;
using System.Collections.Generic;
using System.DirectoryServices;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;

namespace GetMACorIPHelper
{
  public static  class GetMACorIP
    {
        [DllImport(“ws2_32.dll“)]
        private static extern int inet_addr(string cp);

        [DllImport(“IPHLPAPI.dll“)]
        private static extern int SendARP(Int32 DestIP Int32 SrcIP ref Int64 pMacAddr ref Int32 PhyAddrLen);

        /// 
        /// 根据ip地址获得MAC地址
        /// 

        /// 
        /// 
        public static string GetMacAddress(string hostip)//获取远程IP(不能跨网段)的MAC地址
        {
            string Mac = ““;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       7168  2017-05-16 10:27  取局域网IP\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe

     文件      19968  2017-05-16 10:27  取局域网IP\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.pdb

     文件      22656  2017-05-16 10:39  取局域网IP\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe

     文件        490  2014-01-13 21:31  取局域网IP\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.manifest

     文件       2659  2017-05-04 10:49  取局域网IP\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.csproj

     文件       5075  2017-05-15 15:10  取局域网IP\ConsoleApplication1\ConsoleApplication1\GetMACorIP.cs

     文件       1061  2017-05-16 10:39  取局域网IP\ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.csproj.FileListAbsolute.txt

     文件       2069  2017-05-04 10:12  取局域网IP\ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.csprojResolveAssemblyReference.cache

     文件       7168  2017-05-16 10:27  取局域网IP\ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.exe

     文件      19968  2017-05-16 10:27  取局域网IP\ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.pdb

     文件       6668  2017-05-15 15:08  取局域网IP\ConsoleApplication1\ConsoleApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        694  2017-05-15 15:10  取局域网IP\ConsoleApplication1\ConsoleApplication1\Program.cs

     文件       1380  2017-05-04 09:38  取局域网IP\ConsoleApplication1\ConsoleApplication1\Properties\AssemblyInfo.cs

     文件       1026  2017-05-04 09:38  取局域网IP\ConsoleApplication1\ConsoleApplication1.sln

    ..A..H.     39424  2017-05-16 10:40  取局域网IP\ConsoleApplication1\ConsoleApplication1.v12.suo

     目录          0  2017-05-15 15:08  取局域网IP\ConsoleApplication1\ConsoleApplication1\obj\Debug\TempPE

     目录          0  2017-05-08 15:53  取局域网IP\ConsoleApplication1\ConsoleApplication1\bin\Debug

     目录          0  2017-05-16 10:27  取局域网IP\ConsoleApplication1\ConsoleApplication1\obj\Debug

     目录          0  2017-05-08 15:53  取局域网IP\ConsoleApplication1\ConsoleApplication1\bin

     目录          0  2017-05-08 15:53  取局域网IP\ConsoleApplication1\ConsoleApplication1\obj

     目录          0  2017-05-08 15:53  取局域网IP\ConsoleApplication1\ConsoleApplication1\Properties

     目录          0  2017-05-15 15:10  取局域网IP\ConsoleApplication1\ConsoleApplication1

     目录          0  2017-05-08 15:53  取局域网IP\ConsoleApplication1

     目录          0  2017-05-08 15:53  取局域网IP

----------- ---------  ---------- -----  ----

               137474                    24


评论

共有 条评论