Public static string getcustomermac () <br/>{< br/> string IP = system. web. httpcontext. current. request. userhostaddress; <br/> string dirresults = ""; <br/> processstartinfo psi = new processstartinfo (); <br/> process proc = new process (); <br/> psi. filename = "NBTSTAT"; <br/> psi. redirectstandardinput = false; <br/> psi. redirectstandardoutput = true; <br/> psi. arguments = "-a" + IP; <br/> psi. uses Hellexecute = false; <br/> proc = process. start (PSI); <br/> dirresults = Proc. standardoutput. readtoend (); <br/> Proc. waitforexit (); <br/> dirresults = dirresults. replace ("/R ",""). replace ("/N ",""). replace ("/T ",""); <br/> RegEx Reg = new RegEx ("// W {2}-// W {2}-// W {2}-/W {2}-/W {2 }-/ /W {2}-// W {2 }", regexoptions. ignorecase | regexoptions. compiled); <br/> match MC = reg. match (dirresults); <br/> If (MC. success) <Br/> {<br/> return MC. groups [0]. value; <br/>}< br/> else <br/> {<br/> Reg = new RegEx ("Host Not Found", regexoptions. ignorecase | regexoptions. compiled); <br/> MC = reg. match (dirresults); <br/> If (MC. success) <br/>{< br/> return "host not found! "; <Br/>}< br/> else <br/>{< br/> return" "; <br/>}< br/>}
It seems that only the addresses within the same route can be used ..