织梦CMS - 轻松建站从此开始!

罗索

当前位置: 主页>杂项技术>PC常识>

在IS中获取系统信息GetSystemInfo

罗索客 发布于 2004-02-16 15:06 点击:次 
/* written by Jaron ,2003-05-14 */ /* 原出处:B/S WEB技术中文网 http://www.jaron.cn ;*/ /* 转载请注明出处和保留此版权信息 */ /* 欢迎使用SiteManager网站管理系统 http://sitemanager.cnzone.net ; */ Syntax GetSystemInfo (nItem, nvResult, svResult); Descr
TAG:

/* written by Jaron ,2003-05-14 */
/* 原出处:B/S WEB技术中文网 http://www.jaron.cn ;*/
/* 转载请注明出处和保留此版权信息 */
/* 欢迎使用SiteManager网站管理系统 http://sitemanager.cnzone.net ; */

Syntax

GetSystemInfo (nItem, nvResult, svResult);

Description

The GetSystemInfo function retrieves information about the target system.

Parameters

The first parameter, nItem, is used to specify the type of information to retrieve. Consult the table below for a list of constants you can pass in this parameter to retrieve system information. Note that when using certain constants (such as DISK_TOTALSPACE_EX), you must specify additional information in the parameters nvResult and/or svResult before calling the function.

System information is returned in nvResult and/or svResult. Numeric data is returned in nvResult. String data is returned in svResult. The table below shows which type of data is returned for each of the constants you can pass in nItem.


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

nItem: BOOTUPDRIVE
nvResult: The ID of the bootup drive, where 1= A:, 2 = B:, 3 = C:. It is possible to convert this number to the appropriate drive letter by adding 64 (DECIMAL) to the value and then setting a string variable to this value. Use the following syntax to convert:
svResult[0]=64+nvResult;
svResult: Returns the drive designation (that is, the drive letter followed by a colon) of the bootup drive.

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

nItem: CDROM
nvResult: TRUE or FALSE Indicates whether a CD ROM is available.
svResult: N/A

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

nItem: COLORS
nvResult: Returns the number of colors available on the user''s system. The result is retrieved from the video driver on the target system, rather than from the monitor card. If the card can support 256 colors but the driver can handle only 16 colors, the number of colors returned is 16.
svResult: N/A

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

nItem: CPU
nvResult: One of the following constants will be returned:
IS_UNKNOWN  The user''s CPU is unknown.
IS_386  The user has a 386 processor.
IS_486  The user has a 486 processor.
IS_PENTIUM  The user has a PENTIUM processor.
IS_ALPHA  The user has an ALPHA processor.

svResult: N/A

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

nItem: DATE
nvResult: N/A
svResult: The current system date in the format MM-DD-YYYY. Leading zeroes are suppressed in the month and day fields.

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

nItem: DISK_TOTALSPACE
nvResult: Returns the total capacity of the disk drive specified in svResult. The maximum value returned is 2 GB. Total disk space greater than that still returns as 2 GB.
svResult: The letter of the drive. Note that this parameter is passed to the function; that is, you must assign a value to svResult before calling GetSystemInfo. Also note that you must include the colon (:) after the drive letter; otherwise the function will fail. You can also specify a UNC path in this parameter.

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

nItem: DISK_TOTALSPACE_EX
nvResult: Specifies the measurement unit; pass one of the following predefined constants in this parameter: BYTES, KBYTES, MBYTES or GBYTES. Returns the total capacity of the disk drive specified in svResult.
svResult: The letter of the drive. Note that this parameter is passed to the function; that is, you must assign a value to svResult before calling GetSystemInfo. Also note that you must include the colon (:) after the drive letter; otherwise the function will fail. You can also specify a UNC path in this parameter.

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

nItem: DRIVE
nvResult: Returns the type of the drive specified in svResult. One of the following constants will be returned:
IS_UNKNOWN - Target drive is unknown.
IS_REMOVABLE - Target drive is a floppy drive.
IS_FIXED - Target drive is a fixed drive.
IS_CDROM - Target drive is a CD-ROM drive.
IS_REMOTE - Target drive is a network drive.
svResult: The letter of the drive followed by a colon (:). Note this parameter is passed to the function; that is, you must assign a value to svResult before calling GetSystemInfo. You can also specify a UNC path in this parameter.

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

nItem: EXTENDEDMEMORY
nvResult: Returns the total amount of memory installed on the machine. Due to operating system limitations, the value returned may be slightly different than the actual amount of physical memory installed on the system. This value will normally be within 100K (0.1 MB) of the actual value. Note that the value returned is a measurement in kilobytes.
svResult: N/A

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

nItem: LANGUAGE
nvResult: The InstallShield language constant for the target system will be returned in this parameter. The returned constant can be used to determine which language specific file groups to install during the setup using the ComponentFilterLanguage function.

InstallShield International supports 21 languages, while Windows supports over 100 languages. If you intend to filter file groups based on the value of nvResult, you must use a switch statement to determine the InstallShield language identifier constant to use based on the constant returned by this function. The behavior of this function with this parameter is highly system dependent. For information about determining the default language of the target system, click here.


svResult: The equivalent language name string for the language constant returned in nvResult is returned in this parameter.

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

nItem: OS
nvResult: Returns the platform of the target operating system. One of the following constants will be returned:
IS_WINDOWSNT -  Operating system is Windows NT.
IS_WINDOWS9X -
Operating system is Windows 95 or Windows 98. To determine which, call GetSystemInfo with WINMINOR to check the minor version. If less than 10, the operating system is Windows 95; otherwise, it''s Windows 98.


svResult: N/A
The preferred method for indentifying the target operating system''s platform is via the SYSINFO structured variable.


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

nItem: PARALLEL
nvResult: Returns the number of physical parallel ports available.
svResult: N/A

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

nItem: SERIAL
nvResult: Returns the number of physical serial ports available.
svResult: N/A

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

nItem: TIME
nvResult: N/A
svResult: Returns current system time in HH:MM:SS format.

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

nItem: VIDEO
nvResult: Returns the type of video adapter installed. (InstallShield cannot detect CGA or monochrome video drivers.) One of the following constants will be returned:
IS_UNKNOWN - The user''s video is unknown.
IS_EGA - EGA resolution.
IS_VGA - VGA resolution.
IS_SVGA - Super VGA (800 x 600) resolution.
IS_XVGA - XVGA (1024 x 768) resolution.
IS_UVGA - Greater than 1024 x 768 resolution.
svResult: N/A

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

nItem: VOLUMELABEL
nvResult: N/A
svResult: Pass the drive designation (the drive letter followed by a colon) of the disk whose volume label you want to retrieve. The volume label of the specified drive is then returned in this parameter. If the drive has no volume label, a null string ("") is returned.

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

nItem: WINMAJOR
nvResult: Return the major version of Windows.
svResult: Return a string in the format ##.##, which indicates the major and minor versions of Windows.
The preferred method for indentifying the target operating system''s major version number is via the SYSINFO structured variable.


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

nItem: WINMINOR
nvResult: Return the minor version of Windows.
svResult: Return a string in the format ##.##, which indicates the major and minor versions of Windows.
The preferred method for indentifying the target operating system''s minor version number is via the SYSINFO structured variable.


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

Return values

0
Indicates that the function successfully returned the specified information.
< 0
Indicates that the function was unable to return the specified information. (Jaron)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 [http://www.rosoo.net/a/200402/2395.html]
本文出处: 作者:Jaron
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
将本文分享到微信
织梦二维码生成器
推荐内容