Network information such as the MAC address, DNS address of the server network card in ASP

zhaozj2021-02-16  85

For the preface, the author has to do a MIS system development due to the time period, because the MIS is a non-free software, so the corresponding registration module is also required to complete the system development, because the system of the B / S structure, So in registration I chose a unique network card MAC address on the selection. Gossip less, cut into the topic below. Because the system is commercial software, only the following code contains only code ideas, and simple implementation code, you can use it freely according to the code, or you can learn with me.

'-------------------------- Extract all NIC information ------------------ ------ '' ------ Powered by YESOUL SOFT is not fast whitening original, please keep this information http://www.772.cn ----------- ' Public Function GetMacInfo () On Error Resume Next Dim fso, FileStr, AspSleepThread, CmdStr, SysDir, wshshell, CmdRe, MacFileContentFile, MacFileContent Const MacFile = "TmpYesoulSoft001.LLP" Set fso = Server.CreateObject ( "Scripting.FileSystemObject") SysDir = Split (GlobalMod.getsysdir, ",") (1) IF INSTR (LCase (sysdir), "System32") = 0 THEN getMacInfo = "This system can only run in NT, Windows 2000, Windows.net, Windows XP, Windows Under the 32-bit system of 2003, 32-bit systems are not supported! "EXIT FUNCTION ELSE cmdstr = sysdir " /cmd.exe / c " sysdir " /ipconfig.exe / all> " server.mappath (macfile) End If CmdRe = Shell (CmdStr, vbHide) If CmdRe <> 0 Then Set MacFileContentFile = fso.OpenTextFile (Server.MapPath (MacFile), 1, False, TristateUseDefault) 'GetMacInfo = MacFileContentFile.ReadAll () 'Response.Flush FileStr = MacFileContentFile.ReadAll () MacFileContentFile.Close Set MacFileContentFile = Nothing Set AspSleepThread = Server.CreateObject ( "YesoulSoft.SleepThread")' is defined thread suspends time, here, milliseconds AspSleepThread.SleepTime = 500 AspSleepThread.BeginSleepThread GetMacinfo = Executeone (FileStr, "Physical Address................ .: (. *)) SET Aspsleepthread = Nothing else getmacInfo =" The system is currently unable to get your network information, please check the permission inheritance and then run this system! "

转载请注明原文地址:https://www.9cbs.com/read-13013.html

New Post(0)