鸿门宴素材:asp 如何读取机器码

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 16:46:54
用什么函数

谢谢各位了

Creating Active Server Pages for WMI

Microsoft® Active Server Pages (ASP) can create dynamic Web pages by including both server-side and client-side scripts. ASP pages can be much faster than client HTML pages because most of the work is done on the server. You can also use ASP pages to display information about remote computers to other computers that do not have Windows Management Instrumentation (WMI) installed.

To use WMI with ASP

Write an ASP page (.asp) that uses WMI, and place it in a directory accessible to your Web server.
ASP scripts for WMI can be developed with several scripting languages, including Microsoft Visual Basic® Scripting Edition and Microsoft JScript®. You can construct the WMI script part of an ASP page exactly as you construct any other script that uses WMI, with one important restriction: you cannot use asynchronous WMI methods within ASP pages. Note also that any calls to GetObject or CreateObject must be in the server-side code. For more information, see Scripting API for WMI.

If you are using Microsoft Windows® NT version 4.0, ensure that the registry value: HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM\Scripting\Enable for ASP is set to 1. This setting grants the Scripting API all the permissions of the account that runs Internet Information Services (IIS)—rather than the browser client. Because the account that runs IIS is typically an administrator account, it has a high level of permissions. Therefore, setting the registry value can allow scripts too much access to and control of the WMI repository.
If the ASP file can run on Microsoft Windows 2000, Windows XP, or the Windows Server 2003 family, ensure that anonymous access is disabled, and Windows Integrated Authentication is enabled for the ASP file. You can configure these settings for your ASP page by using the IIS snap-in located in the Administrative Tools folder of the Control Panel.

WMI ASP Example: Display Disk Properties

The following script displays several Win32_LogicalDisk properties for each disk instance on a local machine.

<%@ LANGUAGE="VBSCRIPT"%>
<HTML>
<HEAD>
<TITLE>Disk Properties</TITLE>
</HEAD>
<BODY>
<%
On Error Resume Next
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemService = objSWbemLocator.ConnectServer ()

if Err = 0 Then

Set objDisk = objSWbemService.Get ("Win32_LogicalDisk")
Set objPath = objDisk.Path_
objDisk.Security_.ImpersonationLevel = 3
Set objcolDisks = objDisk.Instances_
%>

<P>Path of object is <%=objPath.DisplayName%></P>

<TABLE BORDER>
<TR>
<TH>Name</TH>
<TH>Volume Name</TH>
<TH>Volume Serial Number</TH>
</TR>

<%
for each DiskInstance in objcolDisks
%>
<TR>
<TD><%=DiskInstance.Name%></TD>
<TD><%=DiskInstance.VolumeName%></TD>
<TD><%=DiskInstance.VolumeSerialNumber%></TD>
</TR>
<%
Next
%>

<%
Else
%>
<P>Error - <%=Err.Description%>, <%=Err.Number%>, <%=Err.Source%></P>
<%
end if
%>
</TABLE>
</BODY>
</HTML>

好象没有此类函数,用Activex控件吧